<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.9.1"/>
<title>OCILIB (C and C++ Driver for Oracle): OCILIB main demo application code</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">OCILIB (C and C++ Driver for Oracle)
   &#160;<span id="projectnumber">4.2.1</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.9.1 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>About</span></a></li>
      <li><a href="modules.html"><span>Documentation</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('group___ocilib_c_api_demo_application.html','');});
</script>
<div id="doc-content">
<div class="header">
  <div class="headertitle">
<div class="title">OCILIB main demo application code<div class="ingroups"><a class="el" href="group___ocilib_c_api.html">C API</a></div></div>  </div>
</div><!--header-->
<div class="contents">
<p>Portable Main demo application header </p><div class="fragment"><div class="line"><span class="comment">/*</span></div>
<div class="line"><span class="comment"> * OCILIB - C Driver for Oracle (C Wrapper for Oracle OCI)</span></div>
<div class="line"><span class="comment"> *</span></div>
<div class="line"><span class="comment"> * Website: http://www.ocilib.net</span></div>
<div class="line"><span class="comment"> *</span></div>
<div class="line"><span class="comment"> * Copyright (c) 2007-2016 Vincent ROGIER &lt;vince.rogier@ocilib.net&gt;</span></div>
<div class="line"><span class="comment"> *</span></div>
<div class="line"><span class="comment"> * Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);</span></div>
<div class="line"><span class="comment"> * you may not use this file except in compliance with the License.</span></div>
<div class="line"><span class="comment"> * You may obtain a copy of the License at</span></div>
<div class="line"><span class="comment"> *</span></div>
<div class="line"><span class="comment"> *      http://www.apache.org/licenses/LICENSE-2.0</span></div>
<div class="line"><span class="comment"> *</span></div>
<div class="line"><span class="comment"> * Unless required by applicable law or agreed to in writing, software</span></div>
<div class="line"><span class="comment"> * distributed under the License is distributed on an &quot;AS IS&quot; BASIS,</span></div>
<div class="line"><span class="comment"> * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</span></div>
<div class="line"><span class="comment"> * See the License for the specific language governing permissions and</span></div>
<div class="line"><span class="comment"> * limitations under the License.</span></div>
<div class="line"><span class="comment"> */</span></div>
<div class="line"></div>
<div class="line"><span class="comment">/* --------------------------------------------------------------------------------------------- *</span></div>
<div class="line"><span class="comment"> *</span></div>
<div class="line"><span class="comment"> * THIS DEMO RUNS ON ALL PLATFOMS AND OCILIB BUILDS.</span></div>
<div class="line"><span class="comment"> *</span></div>
<div class="line"><span class="comment"> * SO, WE NEED A LITTLE EFFORT TO KEEP THE SAME SOURCE CODE FOR :</span></div>
<div class="line"><span class="comment"> *</span></div>
<div class="line"><span class="comment"> *    - MS WINDOWS AND UNIXES</span></div>
<div class="line"><span class="comment"> *    - ANSI / WIDE BUILDS</span></div>
<div class="line"><span class="comment"> *</span></div>
<div class="line"><span class="comment"> * SOME DEFINES FOLLOW IN ORDER TO HANDLE ALL THOSE STUFF</span></div>
<div class="line"><span class="comment"> *</span></div>
<div class="line"><span class="comment"> * --------------------------------------------------------------------------------------------- */</span></div>
<div class="line"></div>
<div class="line"><span class="comment">/* --------------------------------------------------------------------------------------------- *</span></div>
<div class="line"><span class="comment"> * COMMON DEFINES</span></div>
<div class="line"><span class="comment"> * --------------------------------------------------------------------------------------------- */</span></div>
<div class="line"></div>
<div class="line"><span class="preprocessor">#define ARG_DB     1</span></div>
<div class="line"><span class="preprocessor">#define ARG_USER   2</span></div>
<div class="line"><span class="preprocessor">#define ARG_PWD    3</span></div>
<div class="line"><span class="preprocessor">#define ARG_HOME   4</span></div>
<div class="line"></div>
<div class="line"><span class="preprocessor">#define ARG_COUNT  5</span></div>
<div class="line"></div>
<div class="line"><span class="preprocessor">#define SIZE_STR   260</span></div>
<div class="line"><span class="preprocessor">#define SIZE_BUF   2048</span></div>
<div class="line"><span class="preprocessor">#define SIZE_TAB   5</span></div>
<div class="line"></div>
<div class="line"><span class="preprocessor">#define SIZE_ARRAY 100</span></div>
<div class="line"><span class="preprocessor">#define NB_LOAD    10</span></div>
<div class="line"><span class="preprocessor">#define SIZE_COL1  20</span></div>
<div class="line"><span class="preprocessor">#define SIZE_COL2  30</span></div>
<div class="line"><span class="preprocessor">#define SIZE_COL3  8</span></div>
<div class="line"><span class="preprocessor">#define NUM_COLS   3</span></div>
<div class="line"></div>
<div class="line"><span class="preprocessor">#define ARRAY_COUNT(t) (sizeof(t)/sizeof(t[0]))</span></div>
<div class="line"></div>
<div class="line"><span class="keyword">typedef</span> <span class="keyword">struct </span>test_t</div>
<div class="line">{</div>
<div class="line">        void (*proc)(void); <span class="comment">/* test procedure */</span></div>
<div class="line">        <span class="keywordtype">int</span>    execute;     <span class="comment">/* do execute the procedure ? */</span></div>
<div class="line">}test_t;</div>
<div class="line"></div>
<div class="line"><span class="comment">/* --------------------------------------------------------------------------------------------- *</span></div>
<div class="line"><span class="comment"> * INCLUDES</span></div>
<div class="line"><span class="comment"> * --------------------------------------------------------------------------------------------- */</span></div>
<div class="line"></div>
<div class="line"><span class="preprocessor">#include &quot;ocilib.h&quot;</span></div>
<div class="line"></div>
<div class="line"><span class="comment">/* --------------------------------------------------------------------------------------------- *</span></div>
<div class="line"><span class="comment"> * PLATFORMS</span></div>
<div class="line"><span class="comment"> * --------------------------------------------------------------------------------------------- */</span></div>
<div class="line"></div>
<div class="line"><span class="preprocessor">#ifdef _MSC_VER</span></div>
<div class="line"></div>
<div class="line"><span class="preprocessor">  #if defined(OCI_CHARSET_WIDE)</span></div>
<div class="line"><span class="preprocessor">      #pragma comment(lib, &quot;ocilibw.lib&quot;)</span></div>
<div class="line"><span class="preprocessor">  #elif defined(OCI_CHARSET_ANSI)</span></div>
<div class="line"><span class="preprocessor">      #pragma comment(lib, &quot;ociliba.lib&quot;)</span></div>
<div class="line"><span class="preprocessor">  #endif</span></div>
<div class="line"></div>
<div class="line"><span class="preprocessor">#endif</span></div>
<div class="line"></div>
<div class="line"><span class="preprocessor">#ifndef OCI_SHARED_LIB</span></div>
<div class="line"><span class="preprocessor">    #if defined(_WINDOWS)</span></div>
<div class="line"><span class="preprocessor">        #define OCI_SHARED_LIB                   &quot;oci.dll&quot;</span></div>
<div class="line"><span class="preprocessor">    #elif defined(__APPLE__)</span></div>
<div class="line"><span class="preprocessor">        #define OCI_SHARED_LIB                   &quot;libclntsh.dylib&quot;</span></div>
<div class="line"><span class="preprocessor">    #elif defined(__hppa)</span></div>
<div class="line"><span class="preprocessor">        #define OCI_SHARED_LIB                   &quot;libclntsh.sl&quot;</span></div>
<div class="line"><span class="preprocessor">    #else</span></div>
<div class="line"><span class="preprocessor">        #define OCI_SHARED_LIB                   &quot;libclntsh.so&quot;</span></div>
<div class="line"><span class="preprocessor">    #endif</span></div>
<div class="line"><span class="preprocessor">#endif</span></div>
<div class="line"></div>
<div class="line"><span class="comment">/* --------------------------------------------------------------------------------------------- *</span></div>
<div class="line"><span class="comment"> * STRING PRINTING</span></div>
<div class="line"><span class="comment"> * --------------------------------------------------------------------------------------------- */</span></div>
<div class="line"></div>
<div class="line"><span class="preprocessor">#define print_frmt(f, x)    printf(f, x)</span></div>
<div class="line"><span class="preprocessor">#define print_text(x)       printf(x)</span></div>
<div class="line"></div>
<div class="line"><span class="preprocessor">#if defined(OCI_CHARSET_WIDE)</span></div>
<div class="line"><span class="preprocessor">    #ifdef _WINDOWS</span></div>
<div class="line"><span class="preprocessor">        #define print_ostr(x)   wprintf(OTEXT(&quot;%s&quot;), x)</span></div>
<div class="line"><span class="preprocessor">#else</span></div>
<div class="line"><span class="preprocessor">        #define print_ostr(x)   printf(&quot;%ls&quot;, x)</span></div>
<div class="line"><span class="preprocessor">#endif</span></div>
<div class="line"><span class="preprocessor">#else</span></div>
<div class="line"><span class="preprocessor">  #define print_ostr(x)   printf(OTEXT(&quot;%s&quot;), x)</span></div>
<div class="line"><span class="preprocessor">#endif</span></div>
<div class="line"></div>
<div class="line"><span class="comment">/* --------------------------------------------------------------------------------------------- *</span></div>
<div class="line"><span class="comment"> * PROGRAM ARGUMENTS</span></div>
<div class="line"><span class="comment"> * --------------------------------------------------------------------------------------------- */</span></div>
<div class="line"></div>
<div class="line"><span class="preprocessor">#if defined(OCI_CHARSET_WIDE)</span></div>
<div class="line"></div>
<div class="line"><span class="preprocessor">  #if defined(_MSC_VER)</span></div>
<div class="line"></div>
<div class="line"><span class="preprocessor">    #define omain           wmain</span></div>
<div class="line"><span class="preprocessor">    #define oarg            otext</span></div>
<div class="line"><span class="preprocessor">    #define print_args(x)   wprintf(x)</span></div>
<div class="line"><span class="preprocessor">    #define GET_ARG(s, i)   ostrncat(s, argv[i], sizeof(s))</span></div>
<div class="line"></div>
<div class="line"><span class="preprocessor">  #else</span></div>
<div class="line"></div>
<div class="line"><span class="preprocessor">    #define omain           main</span></div>
<div class="line"><span class="preprocessor">    #define oarg            char</span></div>
<div class="line"><span class="preprocessor">    #define print_args(x)   printf(x)</span></div>
<div class="line"><span class="preprocessor">    #define GET_ARG(s, i)   mbstowcs(s, argv[i], sizeof(s))</span></div>
<div class="line"></div>
<div class="line"><span class="preprocessor">  #endif</span></div>
<div class="line"></div>
<div class="line"><span class="preprocessor">#else</span></div>
<div class="line"></div>
<div class="line"><span class="preprocessor">  #define omain           main</span></div>
<div class="line"><span class="preprocessor">  #define oarg            char</span></div>
<div class="line"><span class="preprocessor">  #define print_args(x)   printf(x)</span></div>
<div class="line"><span class="preprocessor">  #define GET_ARG(s, i)   strncat(s, argv[i], sizeof(s)-1)</span></div>
<div class="line"></div>
<div class="line"><span class="preprocessor">#endif</span></div>
<div class="line"></div>
<div class="line"></div>
</div><!-- fragment --><p>Portable Main demo application source </p><div class="fragment"><div class="line"><span class="comment">/*</span></div>
<div class="line"><span class="comment"> * OCILIB - C Driver for Oracle (C Wrapper for Oracle OCI)</span></div>
<div class="line"><span class="comment"> *</span></div>
<div class="line"><span class="comment"> * Website: http://www.ocilib.net</span></div>
<div class="line"><span class="comment"> *</span></div>
<div class="line"><span class="comment"> * Copyright (c) 2007-2016 Vincent ROGIER &lt;vince.rogier@ocilib.net&gt;</span></div>
<div class="line"><span class="comment"> *</span></div>
<div class="line"><span class="comment"> * Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);</span></div>
<div class="line"><span class="comment"> * you may not use this file except in compliance with the License.</span></div>
<div class="line"><span class="comment"> * You may obtain a copy of the License at</span></div>
<div class="line"><span class="comment"> *</span></div>
<div class="line"><span class="comment"> *      http://www.apache.org/licenses/LICENSE-2.0</span></div>
<div class="line"><span class="comment"> *</span></div>
<div class="line"><span class="comment"> * Unless required by applicable law or agreed to in writing, software</span></div>
<div class="line"><span class="comment"> * distributed under the License is distributed on an &quot;AS IS&quot; BASIS,</span></div>
<div class="line"><span class="comment"> * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</span></div>
<div class="line"><span class="comment"> * See the License for the specific language governing permissions and</span></div>
<div class="line"><span class="comment"> * limitations under the License.</span></div>
<div class="line"><span class="comment"> */</span></div>
<div class="line"></div>
<div class="line"><span class="preprocessor">#include &quot;ocilib_demo.h&quot;</span></div>
<div class="line"></div>
<div class="line"><span class="comment">/* --------------------------------------------------------------------------------------------- *</span></div>
<div class="line"><span class="comment"> * prototypes</span></div>
<div class="line"><span class="comment"> * --------------------------------------------------------------------------------------------- */</span></div>
<div class="line"></div>
<div class="line"><span class="keywordtype">void</span> err_handler(<a class="code" href="group___ocilib_c_api_datatypes.html#ga8234ab7e71027fd7d139288b2181d4a7">OCI_Error</a> *err);</div>
<div class="line"><span class="keywordtype">void</span> print_version(<span class="keywordtype">void</span>);</div>
<div class="line"></div>
<div class="line"><span class="keywordtype">void</span> cleanup(<span class="keywordtype">void</span>);</div>
<div class="line"><span class="keywordtype">void</span> disconnect(<span class="keywordtype">void</span>);</div>
<div class="line"></div>
<div class="line"><span class="keywordtype">void</span> create_tables(<span class="keywordtype">void</span>);</div>
<div class="line"><span class="keywordtype">void</span> drop_tables(<span class="keywordtype">void</span>);</div>
<div class="line"></div>
<div class="line"><span class="keywordtype">void</span> test_format(<span class="keywordtype">void</span>);</div>
<div class="line"><span class="keywordtype">void</span> test_immediate(<span class="keywordtype">void</span>);</div>
<div class="line"><span class="keywordtype">void</span> test_immediate_format(<span class="keywordtype">void</span>);</div>
<div class="line"><span class="keywordtype">void</span> test_fetch(<span class="keywordtype">void</span>);</div>
<div class="line"><span class="keywordtype">void</span> test_bind1(<span class="keywordtype">void</span>);</div>
<div class="line"><span class="keywordtype">void</span> test_bind2(<span class="keywordtype">void</span>);</div>
<div class="line"><span class="keywordtype">void</span> test_piecewise_insert(<span class="keywordtype">void</span>);</div>
<div class="line"><span class="keywordtype">void</span> test_piecewise_fetch(<span class="keywordtype">void</span>);</div>
<div class="line"><span class="keywordtype">void</span> test_lob(<span class="keywordtype">void</span>);</div>
<div class="line"><span class="keywordtype">void</span> test_nested_table(<span class="keywordtype">void</span>);</div>
<div class="line"><span class="keywordtype">void</span> test_ref_cursor(<span class="keywordtype">void</span>);</div>
<div class="line"><span class="keywordtype">void</span> test_plsql(<span class="keywordtype">void</span>);</div>
<div class="line"><span class="keywordtype">void</span> test_dates(<span class="keywordtype">void</span>);</div>
<div class="line"><span class="keywordtype">void</span> test_timestamp(<span class="keywordtype">void</span>);</div>
<div class="line"><span class="keywordtype">void</span> test_describe(<span class="keywordtype">void</span>);</div>
<div class="line"><span class="keywordtype">void</span> test_returning(<span class="keywordtype">void</span>);</div>
<div class="line"><span class="keywordtype">void</span> test_returning_array(<span class="keywordtype">void</span>);</div>
<div class="line"><span class="keywordtype">void</span> test_object_insert(<span class="keywordtype">void</span>);</div>
<div class="line"><span class="keywordtype">void</span> test_object_fetch(<span class="keywordtype">void</span>);</div>
<div class="line"><span class="keywordtype">void</span> test_object_fetch_string(<span class="keywordtype">void</span>);</div>
<div class="line"><span class="keywordtype">void</span> test_scrollable_cursor(<span class="keywordtype">void</span>);</div>
<div class="line"><span class="keywordtype">void</span> test_collection(<span class="keywordtype">void</span>);</div>
<div class="line"><span class="keywordtype">void</span> test_ref(<span class="keywordtype">void</span>);</div>
<div class="line"><span class="keywordtype">void</span> test_directpath(<span class="keywordtype">void</span>);</div>
<div class="line"></div>
<div class="line"></div>
<div class="line"><span class="comment">/* ocilib test functions array */</span></div>
<div class="line"></div>
<div class="line">test_t tab_test[] =</div>
<div class="line">{</div>
<div class="line">        {test_format,            TRUE},</div>
<div class="line">        {test_immediate,         TRUE},</div>
<div class="line">        {test_immediate_format,  TRUE},</div>
<div class="line">        {test_fetch,             TRUE},</div>
<div class="line">        {test_bind1,             TRUE},</div>
<div class="line">        {test_bind2,             TRUE},</div>
<div class="line">        {test_piecewise_insert,  TRUE},</div>
<div class="line">        {test_piecewise_fetch,   TRUE},</div>
<div class="line">        {test_lob,               TRUE},</div>
<div class="line">        {test_nested_table,      TRUE},</div>
<div class="line">        {test_ref_cursor,        TRUE},</div>
<div class="line">        {test_plsql,             TRUE},</div>
<div class="line">        {test_dates,             TRUE},</div>
<div class="line">        {test_timestamp,         TRUE},</div>
<div class="line">        {test_describe,          TRUE},</div>
<div class="line">        {test_returning,         TRUE},</div>
<div class="line">        {test_returning_array,   TRUE},</div>
<div class="line">        {test_object_insert,     TRUE},</div>
<div class="line">        {test_object_fetch,      TRUE},</div>
<div class="line">        {test_object_fetch_string,  TRUE},</div>
<div class="line">        {test_scrollable_cursor, TRUE},</div>
<div class="line">        {test_collection,        TRUE},</div>
<div class="line">        {test_ref,               TRUE},</div>
<div class="line">        {test_directpath,        TRUE}</div>
<div class="line">};</div>
<div class="line"></div>
<div class="line"><span class="comment">/* --------------------------------------------------------------------------------------------- *</span></div>
<div class="line"><span class="comment"> * variables</span></div>
<div class="line"><span class="comment"> * --------------------------------------------------------------------------------------------- */</span></div>
<div class="line"></div>
<div class="line"><span class="keyword">static</span> <a class="code" href="group___ocilib_c_api_datatypes.html#ga2135d3b5341ebbaae1f54d62873ecf77">OCI_Connection</a> *cn = NULL;</div>
<div class="line"><span class="keyword">static</span> <a class="code" href="group___ocilib_c_api_datatypes.html#ga4b016f1bd7de508b1a919e34b12aa83d">OCI_Statement</a>  *st = NULL;</div>
<div class="line"><span class="keyword">static</span> <a class="code" href="group___ocilib_c_api_datatypes.html#gae0c7aa9c507975d21ca6c261081ba753">OCI_Resultset</a>  *rs = NULL;</div>
<div class="line"></div>
<div class="line"><span class="keyword">static</span> otext str[SIZE_STR+1];</div>
<div class="line"><span class="keyword">static</span> otext temp[SIZE_STR+1];</div>
<div class="line"></div>
<div class="line"><span class="keyword">static</span> <span class="keywordtype">int</span> nb_err  = 0;</div>
<div class="line"><span class="keyword">static</span> <span class="keywordtype">int</span> nb_warn = 0;</div>
<div class="line"></div>
<div class="line"><span class="comment">/* --------------------------------------------------------------------------------------------- *</span></div>
<div class="line"><span class="comment"> * err_handler</span></div>
<div class="line"><span class="comment"> * --------------------------------------------------------------------------------------------- */</span></div>
<div class="line"></div>
<div class="line"><span class="keywordtype">void</span> err_handler(<a class="code" href="group___ocilib_c_api_datatypes.html#ga8234ab7e71027fd7d139288b2181d4a7">OCI_Error</a> *err)</div>
<div class="line">{</div>
<div class="line">    <span class="keywordtype">int</span> err_type = <a class="code" href="group___ocilib_c_api_error_handling.html#ga66d447c8cd06ea3f841b439a1aac055b">OCI_ErrorGetType</a>(err);</div>
<div class="line"></div>
<div class="line">    print_text(<span class="stringliteral">&quot;\n&quot;</span>);</div>
<div class="line"></div>
<div class="line">    <span class="keywordflow">if</span> (err_type == OCI_ERR_WARNING)</div>
<div class="line">    {</div>
<div class="line">         print_text(<span class="stringliteral">&quot;&gt; WARNING : &quot;</span>);</div>
<div class="line">         nb_warn++;</div>
<div class="line">    }</div>
<div class="line">    <span class="keywordflow">else</span></div>
<div class="line">    {</div>
<div class="line">        print_text(<span class="stringliteral">&quot;&gt; ERROR   : &quot;</span>);</div>
<div class="line">        nb_err++;</div>
<div class="line">    }</div>
<div class="line"></div>
<div class="line">    print_ostr(<a class="code" href="group___ocilib_c_api_error_handling.html#ga661d5229057b291ef25bb344315f7c38">OCI_ErrorGetString</a>(err));</div>
<div class="line">    print_text(<span class="stringliteral">&quot;\n&quot;</span>);</div>
<div class="line">}</div>
<div class="line"></div>
<div class="line"><span class="comment">/* --------------------------------------------------------------------------------------------- *</span></div>
<div class="line"><span class="comment"> * main</span></div>
<div class="line"><span class="comment"> * --------------------------------------------------------------------------------------------- */</span></div>
<div class="line"></div>
<div class="line"><span class="keywordtype">int</span> omain(<span class="keywordtype">int</span> argc, oarg* argv[])</div>
<div class="line">{</div>
<div class="line">    otext home[SIZE_STR+1] = OTEXT(<span class="stringliteral">&quot;&quot;</span>);</div>
<div class="line">    otext dbs [SIZE_STR+1] = OTEXT(<span class="stringliteral">&quot;&quot;</span>);</div>
<div class="line">    otext usr [SIZE_STR+1] = OTEXT(<span class="stringliteral">&quot;&quot;</span>);</div>
<div class="line">    otext pwd [SIZE_STR+1] = OTEXT(<span class="stringliteral">&quot;&quot;</span>);</div>
<div class="line"></div>
<div class="line">    <span class="keywordtype">size_t</span> i;</div>
<div class="line"></div>
<div class="line">    <span class="comment">/* CHECK COMMAND LINE --------------------------------------------------- */</span></div>
<div class="line"></div>
<div class="line">    <span class="keywordflow">if</span> (argc &lt; (ARG_COUNT-1))</div>
<div class="line">    {</div>
<div class="line">        <span class="keywordflow">return</span> EXIT_FAILURE;</div>
<div class="line">    }</div>
<div class="line"></div>
<div class="line">    <span class="comment">/* GET ARGUMENTS ---------------------------------------------------------*/</span></div>
<div class="line"></div>
<div class="line">    GET_ARG(dbs, ARG_DB);</div>
<div class="line">    GET_ARG(usr, ARG_USER);</div>
<div class="line">    GET_ARG(pwd, ARG_PWD);</div>
<div class="line"></div>
<div class="line">    <span class="keywordflow">if</span>(argc == ARG_COUNT)</div>
<div class="line">        GET_ARG(home, ARG_HOME);</div>
<div class="line"></div>
<div class="line">    <span class="comment">/* INITIALIZE OCI ------------------------------------------------------- */</span></div>
<div class="line"></div>
<div class="line">    <span class="keywordflow">if</span> (!<a class="code" href="group___ocilib_c_api_initialization.html#ga01464863ddd68393106b63fb8cc1ead1">OCI_Initialize</a>(err_handler, home, OCI_ENV_DEFAULT | OCI_ENV_THREADED))</div>
<div class="line">        <span class="keywordflow">return</span> EXIT_FAILURE;</div>
<div class="line"></div>
<div class="line">    <a class="code" href="group___ocilib_c_api_initialization.html#ga60f3ade91299999200076cd53ed9066e">OCI_EnableWarnings</a>(TRUE);</div>
<div class="line"></div>
<div class="line">    <span class="comment">/* CONNECTION TO SERVER ------------------------------------------------- */</span></div>
<div class="line"></div>
<div class="line">    print_text(<span class="stringliteral">&quot;Connecting to &quot;</span>);</div>
<div class="line">    print_args(usr);</div>
<div class="line">    print_text(<span class="stringliteral">&quot;/&quot;</span>);</div>
<div class="line">    print_args(pwd);</div>
<div class="line">    print_text(<span class="stringliteral">&quot;@&quot;</span>);</div>
<div class="line">    print_args(dbs);</div>
<div class="line">    print_text(<span class="stringliteral">&quot;\n\n&quot;</span>);</div>
<div class="line"></div>
<div class="line">    cn = <a class="code" href="group___ocilib_c_api_connections.html#ga5cd867ad94bdc4a3bbfdef24452262e0">OCI_ConnectionCreate</a>(dbs, usr, pwd, OCI_SESSION_DEFAULT);</div>
<div class="line"></div>
<div class="line">    <span class="keywordflow">if</span> (cn)</div>
<div class="line">    {</div>
<div class="line">        st = <a class="code" href="group___ocilib_c_api_statements.html#ga335822f983af0fb5c529431f06a9a17b">OCI_StatementCreate</a>(cn);</div>
<div class="line"></div>
<div class="line">        print_version();</div>
<div class="line">        create_tables();</div>
<div class="line"></div>
<div class="line">        <span class="comment">/* execute tests */</span></div>
<div class="line"></div>
<div class="line">        <span class="keywordflow">for</span> (i = 0; i &lt; ARRAY_COUNT(tab_test); i++)</div>
<div class="line">        {</div>
<div class="line">            <span class="keywordflow">if</span> (tab_test[i].execute)</div>
<div class="line">                tab_test[i].proc();</div>
<div class="line">        }</div>
<div class="line"></div>
<div class="line">        drop_tables();</div>
<div class="line"></div>
<div class="line">        disconnect();</div>
<div class="line">    }</div>
<div class="line">    <span class="keywordflow">else</span></div>
<div class="line">    {</div>
<div class="line">        print_ostr(<a class="code" href="group___ocilib_c_api_error_handling.html#ga661d5229057b291ef25bb344315f7c38">OCI_ErrorGetString</a>(<a class="code" href="group___ocilib_c_api_error_handling.html#gaf2abe52ad5b278f65dd97a44a2adac4c">OCI_GetLastError</a>()));</div>
<div class="line">    }</div>
<div class="line"></div>
<div class="line">    cleanup();</div>
<div class="line"></div>
<div class="line">    print_text(<span class="stringliteral">&quot;\npress any key to exit...&quot;</span>);</div>
<div class="line"></div>
<div class="line">   <span class="keywordflow">return</span>  getchar() != 0;</div>
<div class="line">}</div>
<div class="line"></div>
<div class="line"><span class="comment">/* --------------------------------------------------------------------------------------------- *</span></div>
<div class="line"><span class="comment"> * cleanup</span></div>
<div class="line"><span class="comment"> * --------------------------------------------------------------------------------------------- */</span></div>
<div class="line"></div>
<div class="line"><span class="keywordtype">void</span> cleanup(<span class="keywordtype">void</span>)</div>
<div class="line">{</div>
<div class="line">    <a class="code" href="group___ocilib_c_api_initialization.html#ga639706aa8e9689c7ebffc018fac6d3ae">OCI_Cleanup</a>();</div>
<div class="line"></div>
<div class="line">    print_frmt(<span class="stringliteral">&quot;\n%i errors   \n&quot;</span>, nb_err);</div>
<div class="line">    print_frmt(<span class="stringliteral">&quot;\n%i warnings \n\n&quot;</span>, nb_warn);</div>
<div class="line">}</div>
<div class="line"></div>
<div class="line"><span class="comment">/* --------------------------------------------------------------------------------------------- *</span></div>
<div class="line"><span class="comment"> * disconnect</span></div>
<div class="line"><span class="comment"> * --------------------------------------------------------------------------------------------- */</span></div>
<div class="line"></div>
<div class="line"><span class="keywordtype">void</span> disconnect(<span class="keywordtype">void</span>)</div>
<div class="line">{</div>
<div class="line">    <a class="code" href="group___ocilib_c_api_connections.html#gac3fe655e96074adb119908be4650a4c9">OCI_ConnectionFree</a>(cn);</div>
<div class="line">}</div>
<div class="line"></div>
<div class="line"><span class="comment">/* --------------------------------------------------------------------------------------------- *</span></div>
<div class="line"><span class="comment"> * print_version</span></div>
<div class="line"><span class="comment"> * --------------------------------------------------------------------------------------------- */</span></div>
<div class="line"></div>
<div class="line"><span class="keywordtype">void</span> print_version(<span class="keywordtype">void</span>)</div>
<div class="line">{</div>
<div class="line">    print_text(<span class="stringliteral">&quot;\n&gt;&gt;&gt;&gt;&gt; OCILIB BUILD INFORMATION \n\n&quot;</span>);</div>
<div class="line"></div>
<div class="line">    <span class="keywordflow">if</span> (<a class="code" href="group___ocilib_c_api_initialization.html#gaecbebbd3747c5012dfbf072f90e33c77">OCI_GetImportMode</a>() == OCI_IMPORT_MODE_LINKAGE)</div>
<div class="line">        print_text(<span class="stringliteral">&quot;OCI import mode         : LINKAGE\n&quot;</span>);</div>
<div class="line">    <span class="keywordflow">else</span></div>
<div class="line">        print_text(<span class="stringliteral">&quot;OCI import mode         : RUNTIME\n&quot;</span>);</div>
<div class="line"></div>
<div class="line">    <span class="keywordflow">if</span> (OCI_GetCharsetMetaData() == OCI_CHAR_ANSI)</div>
<div class="line">        print_text(<span class="stringliteral">&quot;MetaData  char type     : ANSI\n&quot;</span>);</div>
<div class="line">    <span class="keywordflow">else</span></div>
<div class="line">        print_text(<span class="stringliteral">&quot;MetaData  char type     : WIDE\n&quot;</span>);</div>
<div class="line"></div>
<div class="line">    <span class="keywordflow">if</span> (OCI_GetCharsetUserData() == OCI_CHAR_ANSI)</div>
<div class="line">        print_text(<span class="stringliteral">&quot;UserData  char type     : ANSI\n&quot;</span>);</div>
<div class="line">    <span class="keywordflow">else</span></div>
<div class="line">        print_text(<span class="stringliteral">&quot;UserData  char type     : WIDE\n&quot;</span>);</div>
<div class="line"></div>
<div class="line">    print_text(<span class="stringliteral">&quot;\n&gt;&gt;&gt;&gt;&gt; VERSIONS INFORMATION \n\n&quot;</span>);</div>
<div class="line"></div>
<div class="line">    print_frmt(<span class="stringliteral">&quot;OCILIB major    version : %i\n&quot;</span>,   OCILIB_MAJOR_VERSION);</div>
<div class="line">    print_frmt(<span class="stringliteral">&quot;OCILIB minor    version : %i\n&quot;</span>,   OCILIB_MINOR_VERSION);</div>
<div class="line">    print_frmt(<span class="stringliteral">&quot;OCILIB revision version : %i\n\n&quot;</span>, OCILIB_REVISION_VERSION);</div>
<div class="line"></div>
<div class="line">    <span class="comment">/* print all versions */</span></div>
<div class="line">    print_frmt(<span class="stringliteral">&quot;OCI compile     version : %u\n&quot;</span>,   OCI_VER_MAJ(<a class="code" href="group___ocilib_c_api_initialization.html#ga6fa5693d691752f93dbc6baf07e6cceb">OCI_GetOCICompileVersion</a>()));</div>
<div class="line">    print_frmt(<span class="stringliteral">&quot;OCI runtime     version : %u\n\n&quot;</span>, OCI_VER_MAJ(<a class="code" href="group___ocilib_c_api_initialization.html#ga771bf5d33dbd0b63d84242819209b35b">OCI_GetOCIRuntimeVersion</a>()));</div>
<div class="line"></div>
<div class="line">    print_frmt(<span class="stringliteral">&quot;Server major    version : %u\n&quot;</span>,   <a class="code" href="group___ocilib_c_api_connections.html#ga2d7618d8eae73643dd75067a40e656a1">OCI_GetServerMajorVersion</a>(cn));</div>
<div class="line">    print_frmt(<span class="stringliteral">&quot;Server minor    version : %u\n&quot;</span>,   <a class="code" href="group___ocilib_c_api_connections.html#ga8f48a3c755751e5df415160913c6c7ee">OCI_GetServerMinorVersion</a>(cn));</div>
<div class="line">    print_frmt(<span class="stringliteral">&quot;Server revision version : %u\n\n&quot;</span>, <a class="code" href="group___ocilib_c_api_connections.html#gae4c3b37f1c9fc79d36220aa9c96d4415">OCI_GetServerRevisionVersion</a>(cn));</div>
<div class="line"></div>
<div class="line">    print_frmt(<span class="stringliteral">&quot;Connection      version : %u\n\n&quot;</span>, <a class="code" href="group___ocilib_c_api_connections.html#ga6f61147801fce4b69edb4981ba4ea1b7">OCI_GetVersionConnection</a>(cn));</div>
<div class="line"></div>
<div class="line">    print_text(<span class="stringliteral">&quot;\n&gt;&gt;&gt;&gt;&gt; SERVER VERSION BANNER \n\n&quot;</span>);</div>
<div class="line"></div>
<div class="line">    <span class="comment">/* print server string version */</span></div>
<div class="line"></div>
<div class="line">    print_ostr(<a class="code" href="group___ocilib_c_api_connections.html#gab7016c85bd29c1fa9ba5d980da2b615c">OCI_GetVersionServer</a>(cn));</div>
<div class="line"></div>
<div class="line">    print_text(<span class="stringliteral">&quot;\n\n&quot;</span>);</div>
<div class="line"></div>
<div class="line">}</div>
<div class="line"></div>
<div class="line"><span class="comment">/* --------------------------------------------------------------------------------------------- *</span></div>
<div class="line"><span class="comment"> * create_tables</span></div>
<div class="line"><span class="comment"> * --------------------------------------------------------------------------------------------- */</span></div>
<div class="line"></div>
<div class="line"><span class="keywordtype">void</span> create_tables(<span class="keywordtype">void</span>)</div>
<div class="line">{</div>
<div class="line">    print_text(<span class="stringliteral">&quot;\n&gt;&gt;&gt;&gt;&gt; CREATE TABLES FOR DEMO \n\n&quot;</span>);</div>
<div class="line"></div>
<div class="line">    <span class="comment">/* create types for the demo */</span></div>
<div class="line">    <a class="code" href="group___ocilib_c_api_statements.html#ga8b2b66994f847d9f0b6b0efe4a13ccf3">OCI_ExecuteStmt</a>(st, OTEXT(<span class="stringliteral">&quot;create type type_t as OBJECT (id int, name varchar2(50))&quot;</span>));</div>
<div class="line"></div>
<div class="line">    <a class="code" href="group___ocilib_c_api_statements.html#ga8b2b66994f847d9f0b6b0efe4a13ccf3">OCI_ExecuteStmt</a>(st, OTEXT(<span class="stringliteral">&quot;create type test_t as object &quot;</span>)</div>
<div class="line">                    OTEXT(<span class="stringliteral">&quot;( &quot;</span>)</div>
<div class="line">                    OTEXT(<span class="stringliteral">&quot;    val_int  number, &quot;</span>)</div>
<div class="line">                    OTEXT(<span class="stringliteral">&quot;    val_flt  float, &quot;</span>)</div>
<div class="line">                    OTEXT(<span class="stringliteral">&quot;    val_dbl  float, &quot;</span>)</div>
<div class="line">                    OTEXT(<span class="stringliteral">&quot;    val_str  varchar2(30), &quot;</span>)</div>
<div class="line">                    OTEXT(<span class="stringliteral">&quot;    val_date date, &quot;</span>)</div>
<div class="line">                    OTEXT(<span class="stringliteral">&quot;    val_lob  clob, &quot;</span>)</div>
<div class="line">                    OTEXT(<span class="stringliteral">&quot;    val_file bfile, &quot;</span>)</div>
<div class="line">                    OTEXT(<span class="stringliteral">&quot;    val_obj  type_t, &quot;</span>)</div>
<div class="line">                    OTEXT(<span class="stringliteral">&quot;    val_raw  raw(10) &quot;</span>)</div>
<div class="line">                    OTEXT(<span class="stringliteral">&quot;)&quot;</span>));</div>
<div class="line"></div>
<div class="line">    <a class="code" href="group___ocilib_c_api_statements.html#ga8b2b66994f847d9f0b6b0efe4a13ccf3">OCI_ExecuteStmt</a>(st, OTEXT(<span class="stringliteral">&quot;create type t_tab1_emp as VARRAY(100) of varchar2(50)&quot;</span>));</div>
<div class="line"></div>
<div class="line">    <a class="code" href="group___ocilib_c_api_statements.html#ga8b2b66994f847d9f0b6b0efe4a13ccf3">OCI_ExecuteStmt</a>(st, OTEXT(<span class="stringliteral">&quot;create type t_tab2_emp as table of varchar2(50)&quot;</span>));</div>
<div class="line"></div>
<div class="line">    <span class="comment">/* create table for the demo */</span></div>
<div class="line">    <a class="code" href="group___ocilib_c_api_statements.html#ga8b2b66994f847d9f0b6b0efe4a13ccf3">OCI_ExecuteStmt</a>(st, OTEXT(<span class="stringliteral">&quot;create table test_fetch(code int, article &quot;</span>)</div>
<div class="line">                        OTEXT(<span class="stringliteral">&quot;varchar2(30), price float, creation date)&quot;</span>));</div>
<div class="line"></div>
<div class="line">    <a class="code" href="group___ocilib_c_api_statements.html#ga8b2b66994f847d9f0b6b0efe4a13ccf3">OCI_ExecuteStmt</a>(st, OTEXT(<span class="stringliteral">&quot;create table test_long_raw(code int, content long raw)&quot;</span>));</div>
<div class="line"></div>
<div class="line">    <a class="code" href="group___ocilib_c_api_statements.html#ga8b2b66994f847d9f0b6b0efe4a13ccf3">OCI_ExecuteStmt</a>(st, OTEXT(<span class="stringliteral">&quot;create table test_long_str(code int, content long)&quot;</span>));</div>
<div class="line"></div>
<div class="line">    <a class="code" href="group___ocilib_c_api_statements.html#ga8b2b66994f847d9f0b6b0efe4a13ccf3">OCI_ExecuteStmt</a>(st, OTEXT(<span class="stringliteral">&quot;create table test_lob(code int, content clob)&quot;</span>));</div>
<div class="line"></div>
<div class="line">    <a class="code" href="group___ocilib_c_api_statements.html#ga8b2b66994f847d9f0b6b0efe4a13ccf3">OCI_ExecuteStmt</a>(st, OTEXT(<span class="stringliteral">&quot;create table test_object(val test_t)&quot;</span>));</div>
<div class="line"></div>
<div class="line">    <a class="code" href="group___ocilib_c_api_statements.html#ga8b2b66994f847d9f0b6b0efe4a13ccf3">OCI_ExecuteStmt</a>(st, OTEXT(<span class="stringliteral">&quot;create table test_table_obj of type_t&quot;</span>));</div>
<div class="line"></div>
<div class="line">    <a class="code" href="group___ocilib_c_api_statements.html#ga8b2b66994f847d9f0b6b0efe4a13ccf3">OCI_ExecuteStmt</a>(st, OTEXT(<span class="stringliteral">&quot;create table test_array &quot;</span>)</div>
<div class="line">                        OTEXT(<span class="stringliteral">&quot;( &quot;</span>)</div>
<div class="line">                        OTEXT(<span class="stringliteral">&quot;    val_int  number, &quot;</span>)</div>
<div class="line">                        OTEXT(<span class="stringliteral">&quot;    val_dbl  float, &quot;</span>)</div>
<div class="line">                        OTEXT(<span class="stringliteral">&quot;    val_flt  float, &quot;</span>)</div>
<div class="line">                        OTEXT(<span class="stringliteral">&quot;    val_str  varchar2(30), &quot;</span>)</div>
<div class="line">                        OTEXT(<span class="stringliteral">&quot;    val_date date, &quot;</span>)</div>
<div class="line">                        OTEXT(<span class="stringliteral">&quot;    val_lob  clob, &quot;</span>)</div>
<div class="line">                        OTEXT(<span class="stringliteral">&quot;    val_file bfile &quot;</span>)</div>
<div class="line">                        OTEXT(<span class="stringliteral">&quot;)&quot;</span>)</div>
<div class="line">                    );</div>
<div class="line"></div>
<div class="line">    <a class="code" href="group___ocilib_c_api_statements.html#ga8b2b66994f847d9f0b6b0efe4a13ccf3">OCI_ExecuteStmt</a>(st, OTEXT(<span class="stringliteral">&quot;create table test_coll_varray &quot;</span>)</div>
<div class="line">                        OTEXT(<span class="stringliteral">&quot;( &quot;</span>)</div>
<div class="line">                        OTEXT(<span class="stringliteral">&quot;    departement number, &quot;</span>)</div>
<div class="line">                        OTEXT(<span class="stringliteral">&quot;    employees   t_tab1_emp &quot;</span>)</div>
<div class="line">                        OTEXT(<span class="stringliteral">&quot;)&quot;</span>)</div>
<div class="line">                    );</div>
<div class="line"></div>
<div class="line">    <a class="code" href="group___ocilib_c_api_statements.html#ga8b2b66994f847d9f0b6b0efe4a13ccf3">OCI_ExecuteStmt</a>(st, OTEXT(<span class="stringliteral">&quot;create table test_coll_nested &quot;</span>)</div>
<div class="line">                        OTEXT(<span class="stringliteral">&quot;( &quot;</span>)</div>
<div class="line">                        OTEXT(<span class="stringliteral">&quot;    departement number, &quot;</span>)</div>
<div class="line">                        OTEXT(<span class="stringliteral">&quot;    employees   t_tab2_emp &quot;</span>)</div>
<div class="line">                        OTEXT(<span class="stringliteral">&quot;) nested table employees store as test_table_emp&quot;</span>)</div>
<div class="line">                    );</div>
<div class="line"></div>
<div class="line">    <a class="code" href="group___ocilib_c_api_statements.html#ga8b2b66994f847d9f0b6b0efe4a13ccf3">OCI_ExecuteStmt</a>(st, OTEXT(<span class="stringliteral">&quot;create table test_directpath(val_int number(8,4), &quot;</span>)</div>
<div class="line">                        OTEXT(<span class="stringliteral">&quot; val_str varchar2(30), val_date date)&quot;</span>));</div>
<div class="line"></div>
<div class="line">    <span class="comment">/* insert data into the demo tables */</span></div>
<div class="line">    <a class="code" href="group___ocilib_c_api_statements.html#ga8b2b66994f847d9f0b6b0efe4a13ccf3">OCI_ExecuteStmt</a>(st, OTEXT(<span class="stringliteral">&quot;insert into test_fetch &quot;</span>)</div>
<div class="line">                        OTEXT(<span class="stringliteral">&quot;(code, article, price, creation) &quot;</span>)</div>
<div class="line">                        OTEXT(<span class="stringliteral">&quot;values (1, &#39;shoes&#39;, 3.14, to_date(&#39;1978-12-23&#39;, &#39;YYYY-MM-DD&#39;))&quot;</span>));</div>
<div class="line"></div>
<div class="line">    <a class="code" href="group___ocilib_c_api_statements.html#ga8b2b66994f847d9f0b6b0efe4a13ccf3">OCI_ExecuteStmt</a>(st, OTEXT(<span class="stringliteral">&quot;insert into test_fetch &quot;</span>)</div>
<div class="line">                        OTEXT(<span class="stringliteral">&quot;(code, article, price, creation) &quot;</span>)</div>
<div class="line">                        OTEXT(<span class="stringliteral">&quot;values (2, &#39;shirt&#39;, 5.99, to_date(&#39;1999-09-12&#39;, &#39;YYYY-MM-DD&#39;))&quot;</span>));</div>
<div class="line"></div>
<div class="line">    <a class="code" href="group___ocilib_c_api_statements.html#ga8b2b66994f847d9f0b6b0efe4a13ccf3">OCI_ExecuteStmt</a>(st, OTEXT(<span class="stringliteral">&quot;insert into test_lob(code,content)  &quot;</span>)</div>
<div class="line">                        OTEXT(<span class="stringliteral">&quot;values (1, EMPTY_CLOB())&quot;</span>));</div>
<div class="line"></div>
<div class="line">    <a class="code" href="group___ocilib_c_api_statements.html#ga8b2b66994f847d9f0b6b0efe4a13ccf3">OCI_ExecuteStmt</a>(st, OTEXT(<span class="stringliteral">&quot;insert into test_long_str(code,content) &quot;</span>)</div>
<div class="line">                        OTEXT(<span class="stringliteral">&quot;values (1, &#39;Rugby rocks !&#39;)&quot;</span>));</div>
<div class="line"></div>
<div class="line">    <a class="code" href="group___ocilib_c_api_statements.html#ga8b2b66994f847d9f0b6b0efe4a13ccf3">OCI_ExecuteStmt</a>(st, OTEXT(<span class="stringliteral">&quot;insert into test_coll_varray(departement,employees) &quot;</span>)</div>
<div class="line">                        OTEXT(<span class="stringliteral">&quot;values (1, t_tab1_emp(&#39;Peter&#39;, &#39;John&#39;, &#39;Paula&#39;, &#39;Gina&#39;))&quot;</span>));</div>
<div class="line"></div>
<div class="line">    <a class="code" href="group___ocilib_c_api_statements.html#ga8b2b66994f847d9f0b6b0efe4a13ccf3">OCI_ExecuteStmt</a>(st, OTEXT(<span class="stringliteral">&quot;insert into test_coll_varray(departement,employees) &quot;</span>)</div>
<div class="line">                        OTEXT(<span class="stringliteral">&quot;values (2, t_tab1_emp(&#39;Ben&#39;, &#39;Alice&#39;, &#39;Joel&#39;, &#39;Maria&#39;))&quot;</span>));</div>
<div class="line"></div>
<div class="line">    <a class="code" href="group___ocilib_c_api_statements.html#ga8b2b66994f847d9f0b6b0efe4a13ccf3">OCI_ExecuteStmt</a>(st, OTEXT(<span class="stringliteral">&quot;insert into test_coll_nested(departement,employees) &quot;</span>)</div>
<div class="line">                        OTEXT(<span class="stringliteral">&quot;values (1, t_tab2_emp(&#39;Vince&#39;, &#39;Richard&#39;, &#39;Rita&#39;, &#39;Sophia&#39;))&quot;</span>));</div>
<div class="line"></div>
<div class="line">    <a class="code" href="group___ocilib_c_api_statements.html#ga8b2b66994f847d9f0b6b0efe4a13ccf3">OCI_ExecuteStmt</a>(st, OTEXT(<span class="stringliteral">&quot;insert into test_coll_nested(departement,employees) &quot;</span>)</div>
<div class="line">                        OTEXT(<span class="stringliteral">&quot;values (2, t_tab2_emp(&#39;Paul&#39;, &#39;Sarah&#39;, &#39;Robert&#39;, &#39;Zoe&#39;))&quot;</span>));</div>
<div class="line"></div>
<div class="line">    <a class="code" href="group___ocilib_c_api_statements.html#ga8b2b66994f847d9f0b6b0efe4a13ccf3">OCI_ExecuteStmt</a>(st, OTEXT(<span class="stringliteral">&quot;insert into test_table_obj values(type_t(1, &#39;shoes&#39;))&quot;</span>));</div>
<div class="line">    <a class="code" href="group___ocilib_c_api_statements.html#ga8b2b66994f847d9f0b6b0efe4a13ccf3">OCI_ExecuteStmt</a>(st, OTEXT(<span class="stringliteral">&quot;insert into test_table_obj values(type_t(2, &#39;pen&#39;))&quot;</span>));</div>
<div class="line"></div>
<div class="line">    <a class="code" href="group___ocilib_c_api_transactions.html#gaee1ba614ed2dc5bd83bf788ca08f3e71">OCI_Commit</a>(cn);</div>
<div class="line">}</div>
<div class="line"></div>
<div class="line"><span class="comment">/* --------------------------------------------------------------------------------------------- *</span></div>
<div class="line"><span class="comment"> * drop_tables</span></div>
<div class="line"><span class="comment"> * --------------------------------------------------------------------------------------------- */</span></div>
<div class="line"></div>
<div class="line"><span class="keywordtype">void</span> drop_tables(<span class="keywordtype">void</span>)</div>
<div class="line">{</div>
<div class="line">    print_text(<span class="stringliteral">&quot;\n&gt;&gt;&gt;&gt;&gt; DROPPING TABLES AND TYPES \n\n&quot;</span>);</div>
<div class="line"></div>
<div class="line">    <a class="code" href="group___ocilib_c_api_statements.html#ga8b2b66994f847d9f0b6b0efe4a13ccf3">OCI_ExecuteStmt</a>(st, OTEXT(<span class="stringliteral">&quot;drop table test_fetch&quot;</span>));</div>
<div class="line">    <a class="code" href="group___ocilib_c_api_statements.html#ga8b2b66994f847d9f0b6b0efe4a13ccf3">OCI_ExecuteStmt</a>(st, OTEXT(<span class="stringliteral">&quot;drop table test_long_str&quot;</span>));</div>
<div class="line">    <a class="code" href="group___ocilib_c_api_statements.html#ga8b2b66994f847d9f0b6b0efe4a13ccf3">OCI_ExecuteStmt</a>(st, OTEXT(<span class="stringliteral">&quot;drop table test_long_raw&quot;</span>));</div>
<div class="line">    <a class="code" href="group___ocilib_c_api_statements.html#ga8b2b66994f847d9f0b6b0efe4a13ccf3">OCI_ExecuteStmt</a>(st, OTEXT(<span class="stringliteral">&quot;drop table test_lob&quot;</span>));</div>
<div class="line">    <a class="code" href="group___ocilib_c_api_statements.html#ga8b2b66994f847d9f0b6b0efe4a13ccf3">OCI_ExecuteStmt</a>(st, OTEXT(<span class="stringliteral">&quot;drop table test_array&quot;</span>));</div>
<div class="line">    <a class="code" href="group___ocilib_c_api_statements.html#ga8b2b66994f847d9f0b6b0efe4a13ccf3">OCI_ExecuteStmt</a>(st, OTEXT(<span class="stringliteral">&quot;drop table test_object&quot;</span>));</div>
<div class="line">    <a class="code" href="group___ocilib_c_api_statements.html#ga8b2b66994f847d9f0b6b0efe4a13ccf3">OCI_ExecuteStmt</a>(st, OTEXT(<span class="stringliteral">&quot;drop table test_coll_varray&quot;</span>));</div>
<div class="line">    <a class="code" href="group___ocilib_c_api_statements.html#ga8b2b66994f847d9f0b6b0efe4a13ccf3">OCI_ExecuteStmt</a>(st, OTEXT(<span class="stringliteral">&quot;drop table test_coll_nested&quot;</span>));</div>
<div class="line">    <a class="code" href="group___ocilib_c_api_statements.html#ga8b2b66994f847d9f0b6b0efe4a13ccf3">OCI_ExecuteStmt</a>(st, OTEXT(<span class="stringliteral">&quot;drop table test_table_obj&quot;</span>));</div>
<div class="line">    <a class="code" href="group___ocilib_c_api_statements.html#ga8b2b66994f847d9f0b6b0efe4a13ccf3">OCI_ExecuteStmt</a>(st, OTEXT(<span class="stringliteral">&quot;drop table test_directpath&quot;</span>));</div>
<div class="line"></div>
<div class="line">    <a class="code" href="group___ocilib_c_api_statements.html#ga8b2b66994f847d9f0b6b0efe4a13ccf3">OCI_ExecuteStmt</a>(st, OTEXT(<span class="stringliteral">&quot;drop type  test_t&quot;</span>));</div>
<div class="line">    <a class="code" href="group___ocilib_c_api_statements.html#ga8b2b66994f847d9f0b6b0efe4a13ccf3">OCI_ExecuteStmt</a>(st, OTEXT(<span class="stringliteral">&quot;drop type  type_t&quot;</span>));</div>
<div class="line">    <a class="code" href="group___ocilib_c_api_statements.html#ga8b2b66994f847d9f0b6b0efe4a13ccf3">OCI_ExecuteStmt</a>(st, OTEXT(<span class="stringliteral">&quot;drop type  t_tab1_emp&quot;</span>));</div>
<div class="line">    <a class="code" href="group___ocilib_c_api_statements.html#ga8b2b66994f847d9f0b6b0efe4a13ccf3">OCI_ExecuteStmt</a>(st, OTEXT(<span class="stringliteral">&quot;drop type  t_tab2_emp&quot;</span>));</div>
<div class="line"></div>
<div class="line">}</div>
<div class="line"></div>
<div class="line"><span class="comment">/* --------------------------------------------------------------------------------------------- *</span></div>
<div class="line"><span class="comment"> * test_format</span></div>
<div class="line"><span class="comment"> * --------------------------------------------------------------------------------------------- */</span></div>
<div class="line"></div>
<div class="line"><span class="keywordtype">void</span> test_format(<span class="keywordtype">void</span>)</div>
<div class="line">{</div>
<div class="line">    <span class="keywordtype">int</span> code = 1;</div>
<div class="line"></div>
<div class="line">    print_text(<span class="stringliteral">&quot;\n&gt;&gt;&gt;&gt;&gt; TEST FORMATTING \n\n&quot;</span>);</div>
<div class="line"></div>
<div class="line">    <a class="code" href="group___ocilib_c_api_formatting.html#gac8346cd7d4c86cd2c57175bfd77094a9">OCI_ExecuteStmtFmt</a>(st, OTEXT(<span class="stringliteral">&quot;select * from test_fetch where code = %i&quot;</span>), code);</div>
<div class="line"></div>
<div class="line">    rs = <a class="code" href="group___ocilib_c_api_fetching.html#gaf2a9e28b66a9538ba0ffb62bffb87c16">OCI_GetResultset</a>(st);</div>
<div class="line"></div>
<div class="line">    <span class="keywordflow">while</span> (<a class="code" href="group___ocilib_c_api_fetching.html#ga36ac26dcea78f6074421781e401f97ba">OCI_FetchNext</a>(rs))</div>
<div class="line">    {</div>
<div class="line">        print_frmt(<span class="stringliteral">&quot;&gt; code : %i&quot;</span>, <a class="code" href="group___ocilib_c_api_fetching.html#gaa8d80dc30b2012eaddd13efa9dfb711d">OCI_GetInt</a>(rs, 1));</div>
<div class="line">        print_text(<span class="stringliteral">&quot;, action : &quot;</span>); print_ostr(<a class="code" href="group___ocilib_c_api_fetching.html#ga2a3252984f674fab5358c94d58c689b2">OCI_GetString</a>(rs, 2));</div>
<div class="line">        print_frmt(<span class="stringliteral">&quot;, price : %g&quot;</span>, <a class="code" href="group___ocilib_c_api_fetching.html#gadfbe8b6c23200810823e9ca6a1956cd7">OCI_GetDouble</a>(rs,3));</div>
<div class="line">        print_text(<span class="stringliteral">&quot;, date : &quot;</span>); print_ostr(<a class="code" href="group___ocilib_c_api_fetching.html#ga2a3252984f674fab5358c94d58c689b2">OCI_GetString</a>(rs, 4));</div>
<div class="line">        print_text(<span class="stringliteral">&quot;\n&quot;</span>);</div>
<div class="line">   }</div>
<div class="line"></div>
<div class="line">    print_frmt(<span class="stringliteral">&quot;\n%u row(s) fetched\n&quot;</span>, <a class="code" href="group___ocilib_c_api_fetching.html#ga93bd9197720088dbda2bef593ad1c07c">OCI_GetRowCount</a>(rs));</div>
<div class="line">}</div>
<div class="line"></div>
<div class="line"></div>
<div class="line"><span class="comment">/* --------------------------------------------------------------------------------------------- *</span></div>
<div class="line"><span class="comment"> * test_immediate</span></div>
<div class="line"><span class="comment"> * --------------------------------------------------------------------------------------------- */</span></div>
<div class="line"></div>
<div class="line"><span class="keywordtype">void</span> test_immediate(<span class="keywordtype">void</span>)</div>
<div class="line">{</div>
<div class="line">    <span class="keywordtype">int</span> code = 1;</div>
<div class="line"></div>
<div class="line">    print_text(<span class="stringliteral">&quot;\n&gt;&gt;&gt;&gt;&gt; TEST IMMEDIATE \n\n&quot;</span>);</div>
<div class="line"></div>
<div class="line">    <a class="code" href="group___ocilib_c_api_formatting.html#gafc660530b550458f0b5578a06e7a7a27">OCI_Immediate</a>(cn, OTEXT(<span class="stringliteral">&quot;select code, article from test_fetch where code = 1&quot;</span>),</div>
<div class="line">                  OCI_ARG_INT, &amp;code,</div>
<div class="line">                  OCI_ARG_TEXT, temp);</div>
<div class="line"></div>
<div class="line">    print_frmt(<span class="stringliteral">&quot;&gt; code : %i &quot;</span>, code);</div>
<div class="line">    print_text(<span class="stringliteral">&quot;- article : &quot;</span>); print_ostr(temp);</div>
<div class="line">    print_text(<span class="stringliteral">&quot;\n&quot;</span>);</div>
<div class="line">}</div>
<div class="line"></div>
<div class="line"><span class="comment">/* --------------------------------------------------------------------------------------------- *</span></div>
<div class="line"><span class="comment"> * test_immediate_format</span></div>
<div class="line"><span class="comment"> * --------------------------------------------------------------------------------------------- */</span></div>
<div class="line"></div>
<div class="line"><span class="keywordtype">void</span> test_immediate_format(<span class="keywordtype">void</span>)</div>
<div class="line">{</div>
<div class="line">    <span class="keywordtype">int</span> code = 1;</div>
<div class="line"></div>
<div class="line">    print_text(<span class="stringliteral">&quot;\n&gt;&gt;&gt;&gt;&gt; TEST IMMEDIATE FORMATTED\n\n&quot;</span>);</div>
<div class="line"></div>
<div class="line">    <a class="code" href="group___ocilib_c_api_formatting.html#ga24a69e3d1d683ce6023afd687af78720">OCI_ImmediateFmt</a>(cn, OTEXT(<span class="stringliteral">&quot;select article from test_fetch where code = %i&quot;</span>),</div>
<div class="line">                     code, OCI_ARG_TEXT, temp);</div>
<div class="line"></div>
<div class="line">    print_text(<span class="stringliteral">&quot;&gt; article : &quot;</span>); print_ostr(temp);  print_text(<span class="stringliteral">&quot;\n&quot;</span>);</div>
<div class="line">}</div>
<div class="line"></div>
<div class="line"><span class="comment">/* --------------------------------------------------------------------------------------------- *</span></div>
<div class="line"><span class="comment"> * test_fetch</span></div>
<div class="line"><span class="comment"> * --------------------------------------------------------------------------------------------- */</span></div>
<div class="line"></div>
<div class="line"><span class="keywordtype">void</span> test_fetch(<span class="keywordtype">void</span>)</div>
<div class="line">{</div>
<div class="line">    <span class="keywordtype">int</span> i, n;</div>
<div class="line"></div>
<div class="line">    print_text(<span class="stringliteral">&quot;\n&gt;&gt;&gt;&gt;&gt; SIMPLE TEST FETCH WITH META DATA\n\n&quot;</span>);</div>
<div class="line"></div>
<div class="line">    <span class="comment">/* execute query in one go */</span></div>
<div class="line">    <a class="code" href="group___ocilib_c_api_statements.html#ga8b2b66994f847d9f0b6b0efe4a13ccf3">OCI_ExecuteStmt</a>(st, OTEXT(<span class="stringliteral">&quot;select * from test_fetch&quot;</span>));</div>
<div class="line"></div>
<div class="line">    rs = <a class="code" href="group___ocilib_c_api_fetching.html#gaf2a9e28b66a9538ba0ffb62bffb87c16">OCI_GetResultset</a>(st);</div>
<div class="line">    n  = <a class="code" href="group___ocilib_c_api_fetching.html#ga8935f9c6ff0d6f1d94c70afb3418a916">OCI_GetColumnCount</a>(rs);</div>
<div class="line"></div>
<div class="line">    <span class="comment">/* print resultset columns info */</span></div>
<div class="line">    <span class="keywordflow">for</span>(i = 1; i &lt;= n; i++)</div>
<div class="line">    {</div>
<div class="line">        <a class="code" href="group___ocilib_c_api_datatypes.html#gac0a3096f1a717d9417d9639e6da7dc56">OCI_Column</a> *col = <a class="code" href="group___ocilib_c_api_fetching.html#ga7b64be082fc14ac73347b081cdb66de0">OCI_GetColumn</a>(rs, i);</div>
<div class="line"></div>
<div class="line">        print_frmt(<span class="stringliteral">&quot;&gt; Field : #%i &quot;</span>, i);</div>
<div class="line">        print_text(<span class="stringliteral">&quot;- Name  : &quot;</span>); print_ostr(<a class="code" href="group___ocilib_c_api_fetching.html#ga9838be3f2abccc13a01bd395b2ae5121">OCI_ColumnGetName</a>(col));</div>
<div class="line">        print_text(<span class="stringliteral">&quot;\n&quot;</span>);</div>
<div class="line">    }</div>
<div class="line"></div>
<div class="line">    print_text(<span class="stringliteral">&quot;\n&quot;</span>);</div>
<div class="line"></div>
<div class="line">    <span class="comment">/* print resultset content */</span></div>
<div class="line">    <span class="keywordflow">while</span> (<a class="code" href="group___ocilib_c_api_fetching.html#ga36ac26dcea78f6074421781e401f97ba">OCI_FetchNext</a>(rs))</div>
<div class="line">    {</div>
<div class="line">        print_frmt(<span class="stringliteral">&quot;&gt; code : %i&quot;</span>, <a class="code" href="group___ocilib_c_api_fetching.html#gaa8d80dc30b2012eaddd13efa9dfb711d">OCI_GetInt</a>(rs, 1));</div>
<div class="line">        print_text(<span class="stringliteral">&quot;, action : &quot;</span>); print_ostr(<a class="code" href="group___ocilib_c_api_fetching.html#ga2a3252984f674fab5358c94d58c689b2">OCI_GetString</a>(rs, 2));</div>
<div class="line">        print_frmt(<span class="stringliteral">&quot;, price : %g&quot;</span>, <a class="code" href="group___ocilib_c_api_fetching.html#gadfbe8b6c23200810823e9ca6a1956cd7">OCI_GetDouble</a>(rs,3));</div>
<div class="line">        print_text(<span class="stringliteral">&quot;, date : &quot;</span>); print_ostr(<a class="code" href="group___ocilib_c_api_fetching.html#ga2a3252984f674fab5358c94d58c689b2">OCI_GetString</a>(rs, 4));</div>
<div class="line">        print_text(<span class="stringliteral">&quot;\n&quot;</span>);</div>
<div class="line">    }</div>
<div class="line"></div>
<div class="line">    print_frmt(<span class="stringliteral">&quot;\n%u row(s) fetched\n&quot;</span>, <a class="code" href="group___ocilib_c_api_fetching.html#ga93bd9197720088dbda2bef593ad1c07c">OCI_GetRowCount</a>(rs));</div>
<div class="line">}</div>
<div class="line"></div>
<div class="line"><span class="comment">/* --------------------------------------------------------------------------------------------- *</span></div>
<div class="line"><span class="comment"> * test_bind1</span></div>
<div class="line"><span class="comment"> * --------------------------------------------------------------------------------------------- */</span></div>
<div class="line"></div>
<div class="line"><span class="keywordtype">void</span> test_bind1(<span class="keywordtype">void</span>)</div>
<div class="line">{</div>
<div class="line">    <span class="keywordtype">int</span> code = 1;</div>
<div class="line"></div>
<div class="line">    print_text(<span class="stringliteral">&quot;\n&gt;&gt;&gt;&gt;&gt; TEST BINDING \n\n&quot;</span>);</div>
<div class="line"></div>
<div class="line">    <span class="comment">/* execute query in three steps */</span></div>
<div class="line">    <a class="code" href="group___ocilib_c_api_statements.html#ga592e4b3cf3df7e152c46fab5d6e3b3af">OCI_Prepare</a>(st, OTEXT(<span class="stringliteral">&quot;select * from test_fetch where code = :code&quot;</span>));</div>
<div class="line">    <a class="code" href="group___ocilib_c_api_binding.html#gab0be696e4216d8573dd75ed29b4979e3">OCI_BindInt</a>(st, OTEXT(<span class="stringliteral">&quot;:code&quot;</span>), &amp;code);</div>
<div class="line">    <a class="code" href="group___ocilib_c_api_statements.html#ga7189aa353845909aaedc8d5956429450">OCI_Execute</a>(st);</div>
<div class="line"></div>
<div class="line">    rs = <a class="code" href="group___ocilib_c_api_fetching.html#gaf2a9e28b66a9538ba0ffb62bffb87c16">OCI_GetResultset</a>(st);</div>
<div class="line"></div>
<div class="line">    <span class="comment">/* print resultset content */</span></div>
<div class="line">    <span class="keywordflow">while</span> (<a class="code" href="group___ocilib_c_api_fetching.html#ga36ac26dcea78f6074421781e401f97ba">OCI_FetchNext</a>(rs))</div>
<div class="line">    {</div>
<div class="line">        print_frmt(<span class="stringliteral">&quot;&gt; code : %i&quot;</span>, <a class="code" href="group___ocilib_c_api_fetching.html#gaa8d80dc30b2012eaddd13efa9dfb711d">OCI_GetInt</a>(rs, 1));</div>
<div class="line">        print_text(<span class="stringliteral">&quot;, action : &quot;</span>); print_ostr(<a class="code" href="group___ocilib_c_api_fetching.html#ga2a3252984f674fab5358c94d58c689b2">OCI_GetString</a>(rs, 2));</div>
<div class="line">        print_frmt(<span class="stringliteral">&quot;, price : %g&quot;</span>, <a class="code" href="group___ocilib_c_api_fetching.html#gadfbe8b6c23200810823e9ca6a1956cd7">OCI_GetDouble</a>(rs,3));</div>
<div class="line">        print_text(<span class="stringliteral">&quot;, date : &quot;</span>); print_ostr(<a class="code" href="group___ocilib_c_api_fetching.html#ga2a3252984f674fab5358c94d58c689b2">OCI_GetString</a>(rs, 4));</div>
<div class="line">        print_text(<span class="stringliteral">&quot;\n&quot;</span>);</div>
<div class="line">    }</div>
<div class="line"></div>
<div class="line">    print_frmt(<span class="stringliteral">&quot;\n%u row(s) fetched\n&quot;</span>, <a class="code" href="group___ocilib_c_api_fetching.html#ga93bd9197720088dbda2bef593ad1c07c">OCI_GetRowCount</a>(rs));</div>
<div class="line">}</div>
<div class="line"></div>
<div class="line"><span class="comment">/* --------------------------------------------------------------------------------------------- *</span></div>
<div class="line"><span class="comment"> * test_bind2</span></div>
<div class="line"><span class="comment"> * --------------------------------------------------------------------------------------------- */</span></div>
<div class="line"></div>
<div class="line"><span class="keywordtype">void</span> test_bind2(<span class="keywordtype">void</span>)</div>
<div class="line">{</div>
<div class="line">    <a class="code" href="group___ocilib_c_api_datatypes.html#ga8b274b67a4c2320612d4dfb3083131f5">OCI_Lob</a> *lob;</div>
<div class="line">    <a class="code" href="group___ocilib_c_api_datatypes.html#ga549efec5df4c0825db908a5ceb9ab614">OCI_Date</a> *date;</div>
<div class="line">    <a class="code" href="group___ocilib_c_api_datatypes.html#gad57163fd9169661f31821898c0a86b1d">OCI_File</a> *file;</div>
<div class="line"></div>
<div class="line">    <span class="keywordtype">int</span> i;</div>
<div class="line">    <span class="keywordtype">double</span> dbl;</div>
<div class="line">    <span class="keywordtype">float</span> flt;</div>
<div class="line"></div>
<div class="line">    print_text(<span class="stringliteral">&quot;\n&gt;&gt;&gt;&gt;&gt; SINGLE BINDING \n\n&quot;</span>);</div>
<div class="line"></div>
<div class="line">   <span class="comment">/* prepare SQL */</span></div>
<div class="line"></div>
<div class="line">    <a class="code" href="group___ocilib_c_api_statements.html#ga592e4b3cf3df7e152c46fab5d6e3b3af">OCI_Prepare</a>(st, OTEXT(<span class="stringliteral">&quot;insert into test_array &quot;</span>)</div>
<div class="line">                    OTEXT(<span class="stringliteral">&quot;( &quot;</span>)</div>
<div class="line">                    OTEXT(<span class="stringliteral">&quot;   val_int,  val_dbl, val_flt, val_str, val_date, &quot;</span>)</div>
<div class="line">                    OTEXT(<span class="stringliteral">&quot;   val_lob, val_file &quot;</span>)</div>
<div class="line">                    OTEXT(<span class="stringliteral">&quot;) &quot;</span> )</div>
<div class="line">                    OTEXT(<span class="stringliteral">&quot;values &quot;</span>)</div>
<div class="line">                    OTEXT(<span class="stringliteral">&quot;( &quot;</span>)</div>
<div class="line">                    OTEXT(<span class="stringliteral">&quot;   :val_int, :val_dbl, :val_flt, :val_str, :val_date, &quot;</span>)</div>
<div class="line">                    OTEXT(<span class="stringliteral">&quot;   :val_lob, :val_file &quot;</span>)</div>
<div class="line">                    OTEXT(<span class="stringliteral">&quot;) &quot;</span>));</div>
<div class="line"></div>
<div class="line">    <span class="comment">/* create objects and set values */</span></div>
<div class="line"></div>
<div class="line">    <span class="comment">/* date */</span></div>
<div class="line">    date = <a class="code" href="group___ocilib_c_api_datetimes.html#gae80eacef54641a68c3b82be85f4a5042">OCI_DateCreate</a>(cn);</div>
<div class="line">    <a class="code" href="group___ocilib_c_api_datetimes.html#gad7c5c65d88b52e6ecb46b3e9ba8843dc">OCI_DateSysDate</a>(date);</div>
<div class="line"></div>
<div class="line">    <span class="comment">/* lob */</span></div>
<div class="line">    lob = <a class="code" href="group___ocilib_c_api_lobs.html#ga318f1273603e24b51c3d9e4c29f42685">OCI_LobCreate</a>(cn, OCI_CLOB);</div>
<div class="line">    osprintf(temp, SIZE_STR, OTEXT(<span class="stringliteral">&quot;lob value00&quot;</span>));</div>
<div class="line">    <a class="code" href="group___ocilib_c_api_lobs.html#ga949f7050609430486c9ef0f3c488d38a">OCI_LobWrite</a>(lob, temp, (<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span>) ostrlen(temp));</div>
<div class="line"></div>
<div class="line">    <span class="comment">/* file */</span></div>
<div class="line">    file = <a class="code" href="group___ocilib_c_api_files.html#ga199d6ce1a1231feb56b456ad6cbc2714">OCI_FileCreate</a>(cn, OCI_BFILE);</div>
<div class="line">    <a class="code" href="group___ocilib_c_api_files.html#ga17e77f8545ef10e2a081b19ae915a6ae">OCI_FileSetName</a>(file, OTEXT(<span class="stringliteral">&quot;mydir&quot;</span>), OTEXT(<span class="stringliteral">&quot;file00.txt&quot;</span>));</div>
<div class="line"></div>
<div class="line">    <span class="comment">/* scalar types */</span></div>
<div class="line">    i   = 1;</div>
<div class="line">    dbl = 3.14;</div>
<div class="line">    flt = (float) 3.14;</div>
<div class="line">    osprintf(temp, 30, OTEXT(<span class="stringliteral">&quot;Name00&quot;</span>));</div>
<div class="line"></div>
<div class="line">    <span class="comment">/* bind scalar C types arrays */</span></div>
<div class="line"></div>
<div class="line">    <a class="code" href="group___ocilib_c_api_binding.html#gab0be696e4216d8573dd75ed29b4979e3">OCI_BindInt</a>(st, OTEXT(<span class="stringliteral">&quot;:val_int&quot;</span>),  &amp;i);</div>
<div class="line">    <a class="code" href="group___ocilib_c_api_binding.html#ga62c0c66c23fc300f014fc649f033578f">OCI_BindDouble</a>(st, OTEXT(<span class="stringliteral">&quot;:val_dbl&quot;</span>), &amp;dbl);</div>
<div class="line">    <a class="code" href="group___ocilib_c_api_binding.html#ga20ed307eeebd5ae100341ff9eccc31dd">OCI_BindFloat</a>(st, OTEXT(<span class="stringliteral">&quot;:val_flt&quot;</span>), &amp;flt);</div>
<div class="line">    <a class="code" href="group___ocilib_c_api_binding.html#ga0f16a196cf07da47411fa3586bf07468">OCI_BindString</a>(st, OTEXT(<span class="stringliteral">&quot;:val_str&quot;</span>), (otext*) temp, 30);</div>
<div class="line"></div>
<div class="line">    <span class="comment">/* bind oracle types arrays */</span></div>
<div class="line"></div>
<div class="line">    <a class="code" href="group___ocilib_c_api_binding.html#ga1b1e4bc13b2cbb3c86b2391756981cbe">OCI_BindDate</a>(st, OTEXT(<span class="stringliteral">&quot;:val_date&quot;</span>), date);</div>
<div class="line">    <a class="code" href="group___ocilib_c_api_binding.html#gaa7b6ca05d3a872e470bb356a3a11e04a">OCI_BindLob</a>(st, OTEXT(<span class="stringliteral">&quot;:val_lob&quot;</span>), lob);</div>
<div class="line">    <a class="code" href="group___ocilib_c_api_binding.html#gaa38da0b6c33326c068d38ceeeb60c2b6">OCI_BindFile</a>(st, OTEXT(<span class="stringliteral">&quot;:val_file&quot;</span>), file);</div>
<div class="line"></div>
<div class="line">    <span class="comment">/* do insert */</span></div>
<div class="line"></div>
<div class="line">    <a class="code" href="group___ocilib_c_api_statements.html#ga7189aa353845909aaedc8d5956429450">OCI_Execute</a>(st);</div>
<div class="line"></div>
<div class="line">    print_frmt(<span class="stringliteral">&quot;Row inserted : %u\n\n&quot;</span>, <a class="code" href="group___ocilib_c_api_statements.html#ga1cf932261960da80cd36d650a08565c3">OCI_GetAffectedRows</a>(st));</div>
<div class="line"></div>
<div class="line">    <span class="comment">/* free objets */</span></div>
<div class="line"></div>
<div class="line">    <a class="code" href="group___ocilib_c_api_datetimes.html#gaedf77cfe4bd5dab7909e4c2fb5173b48">OCI_DateFree</a>(date);</div>
<div class="line">    <a class="code" href="group___ocilib_c_api_lobs.html#gaac269a3de312c2c7d1a6193a9ab79545">OCI_LobFree</a>(lob);</div>
<div class="line">    <a class="code" href="group___ocilib_c_api_files.html#gad4b58b6d80e24bb045fb82d78c5cf36a">OCI_FileFree</a>(file);</div>
<div class="line"></div>
<div class="line">    <span class="comment">/* commit; */</span></div>
<div class="line"></div>
<div class="line">    <a class="code" href="group___ocilib_c_api_transactions.html#gaee1ba614ed2dc5bd83bf788ca08f3e71">OCI_Commit</a>(cn);</div>
<div class="line">}</div>
<div class="line"></div>
<div class="line"><span class="comment">/* --------------------------------------------------------------------------------------------- *</span></div>
<div class="line"><span class="comment"> * test_piecewise_insert</span></div>
<div class="line"><span class="comment"> * --------------------------------------------------------------------------------------------- */</span></div>
<div class="line"></div>
<div class="line"><span class="keywordtype">void</span> test_piecewise_insert(<span class="keywordtype">void</span>)</div>
<div class="line">{</div>
<div class="line">    FILE *f;</div>
<div class="line"></div>
<div class="line">    print_text(<span class="stringliteral">&quot;\n&gt;&gt;&gt;&gt;&gt; TEST PIECEWISE INSERTING\n\n&quot;</span>);</div>
<div class="line"></div>
<div class="line">    <span class="comment">/* this code could have been used with a text file in a LONG column</span></div>
<div class="line"><span class="comment">       as well...  */</span></div>
<div class="line"></div>
<div class="line">    <span class="comment">/* open the app file in for reading*/</span></div>
<div class="line"></div>
<div class="line">    f = fopen(OCI_SHARED_LIB, <span class="stringliteral">&quot;rb&quot;</span>);</div>
<div class="line"></div>
<div class="line">    <span class="keywordflow">if</span> (f)</div>
<div class="line">    {</div>
<div class="line">        <span class="keywordtype">int</span> n;</div>
<div class="line">        <a class="code" href="group___ocilib_c_api_datatypes.html#ga95e122a9e888afdd674803e521557aba">OCI_Long</a> *lg;</div>
<div class="line">        <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> buffer[SIZE_BUF];</div>
<div class="line"></div>
<div class="line">        fseek (f , 0 , SEEK_END);</div>
<div class="line">        n = ftell(f);</div>
<div class="line">        rewind (f);</div>
<div class="line"></div>
<div class="line">        print_frmt(<span class="stringliteral">&quot;\n%d bytes to write\n&quot;</span>, n);</div>
<div class="line"></div>
<div class="line">        lg = <a class="code" href="group___ocilib_c_api_longs.html#ga040ec19ae09a29b34e0143e39ab30939">OCI_LongCreate</a>(st, OCI_BLONG);</div>
<div class="line"></div>
<div class="line">        <span class="comment">/* execute query in three steps */</span></div>
<div class="line">        <a class="code" href="group___ocilib_c_api_statements.html#ga592e4b3cf3df7e152c46fab5d6e3b3af">OCI_Prepare</a>(st,  OTEXT(<span class="stringliteral">&quot;insert into test_long_raw(code, content) &quot;</span>)</div>
<div class="line">                         OTEXT(<span class="stringliteral">&quot;values (1, :data)&quot;</span>));</div>
<div class="line"></div>
<div class="line">        <a class="code" href="group___ocilib_c_api_binding.html#gab889e6aadf49c248713ada483bafccc0">OCI_BindLong</a>(st, OTEXT(<span class="stringliteral">&quot;:data&quot;</span>), lg, n);</div>
<div class="line">        <a class="code" href="group___ocilib_c_api_statements.html#ga7189aa353845909aaedc8d5956429450">OCI_Execute</a>(st);</div>
<div class="line"></div>
<div class="line">        <span class="comment">/* write data into table by chunks of 2048 bytes */</span></div>
<div class="line">        <span class="keywordflow">while</span> ((n = (<span class="keywordtype">int</span>) fread(buffer, 1, <span class="keyword">sizeof</span>(buffer), f)))</div>
<div class="line">        {</div>
<div class="line">            <a class="code" href="group___ocilib_c_api_longs.html#ga1a76c2c5de1c81d38be17bf28524ce99">OCI_LongWrite</a>(lg, buffer, n);</div>
<div class="line">        }</div>
<div class="line"></div>
<div class="line">        print_frmt(<span class="stringliteral">&quot;\n%u bytes written\n&quot;</span>, <a class="code" href="group___ocilib_c_api_longs.html#gaf7ed15bc901e38b9bc3394f334bf8d4c">OCI_LongGetSize</a>(lg));</div>
<div class="line">        fclose(f);</div>
<div class="line"></div>
<div class="line">        <a class="code" href="group___ocilib_c_api_longs.html#gadc23551bd5aa7832cbaee4e32a2b283a">OCI_LongFree</a>(lg);</div>
<div class="line">        <a class="code" href="group___ocilib_c_api_transactions.html#gaee1ba614ed2dc5bd83bf788ca08f3e71">OCI_Commit</a>(cn);</div>
<div class="line">    }</div>
<div class="line">}</div>
<div class="line"></div>
<div class="line"><span class="comment">/* --------------------------------------------------------------------------------------------- *</span></div>
<div class="line"><span class="comment"> * test_piecewise_fetch</span></div>
<div class="line"><span class="comment"> * --------------------------------------------------------------------------------------------- */</span></div>
<div class="line"></div>
<div class="line"><span class="keywordtype">void</span> test_piecewise_fetch(<span class="keywordtype">void</span>)</div>
<div class="line">{</div>
<div class="line">    <a class="code" href="group___ocilib_c_api_datatypes.html#ga95e122a9e888afdd674803e521557aba">OCI_Long</a> *lg;</div>
<div class="line">    <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> buffer[SIZE_BUF];</div>
<div class="line">    <span class="keywordtype">int</span> n;</div>
<div class="line"></div>
<div class="line">    print_text(<span class="stringliteral">&quot;\n&gt;&gt;&gt;&gt;&gt; TEST PIECEWISE FETCHING\n\n&quot;</span>);</div>
<div class="line"></div>
<div class="line">    <span class="comment">/* execute query in one go */</span></div>
<div class="line">    <a class="code" href="group___ocilib_c_api_statements.html#ga8b2b66994f847d9f0b6b0efe4a13ccf3">OCI_ExecuteStmt</a>(st, OTEXT(<span class="stringliteral">&quot;select content from test_long_raw &quot;</span>)</div>
<div class="line">                              OTEXT(<span class="stringliteral">&quot;where code = 1&quot;</span>));</div>
<div class="line"></div>
<div class="line">    rs = <a class="code" href="group___ocilib_c_api_fetching.html#gaf2a9e28b66a9538ba0ffb62bffb87c16">OCI_GetResultset</a>(st);</div>
<div class="line"></div>
<div class="line">    <span class="comment">/* read data by chunks of 2048 bytes*/</span></div>
<div class="line">    <span class="keywordflow">while</span> (<a class="code" href="group___ocilib_c_api_fetching.html#ga36ac26dcea78f6074421781e401f97ba">OCI_FetchNext</a>(rs))</div>
<div class="line">    {</div>
<div class="line">        lg = <a class="code" href="group___ocilib_c_api_fetching.html#ga8c750dc1ea6d90c61cc2ebff5fb0c561">OCI_GetLong</a>(rs, 1);</div>
<div class="line"></div>
<div class="line">        <span class="keywordflow">while</span> ((n = <a class="code" href="group___ocilib_c_api_longs.html#gad7e0ba53269cc2d5aace557a984c8717">OCI_LongRead</a>(lg, buffer, <span class="keyword">sizeof</span>(buffer)))) {}</div>
<div class="line"></div>
<div class="line">        print_frmt(<span class="stringliteral">&quot;\n%u bytes read\n&quot;</span>, <a class="code" href="group___ocilib_c_api_longs.html#gaf7ed15bc901e38b9bc3394f334bf8d4c">OCI_LongGetSize</a>(lg));</div>
<div class="line">    }</div>
<div class="line"></div>
<div class="line">    print_frmt(<span class="stringliteral">&quot;\n%u row(s) fetched\n&quot;</span>, <a class="code" href="group___ocilib_c_api_fetching.html#ga93bd9197720088dbda2bef593ad1c07c">OCI_GetRowCount</a>(rs));</div>
<div class="line"></div>
<div class="line">    print_text(<span class="stringliteral">&quot;\n&gt;&gt;&gt;&gt;&gt; TEST LONG MAPPED TO STRING\n\n&quot;</span>);</div>
<div class="line"></div>
<div class="line">    <a class="code" href="group___ocilib_c_api_statements.html#ga8b2b66994f847d9f0b6b0efe4a13ccf3">OCI_ExecuteStmt</a>(st, OTEXT(<span class="stringliteral">&quot;select content from test_long_str &quot;</span>)</div>
<div class="line">                        OTEXT(<span class="stringliteral">&quot;where code = 1&quot;</span>));</div>
<div class="line">    <a class="code" href="group___ocilib_c_api_statement_control.html#gae92422b723eef25355d91e0b50c09c0c">OCI_SetLongMode</a>(st, OCI_LONG_IMPLICIT);</div>
<div class="line">    rs = <a class="code" href="group___ocilib_c_api_fetching.html#gaf2a9e28b66a9538ba0ffb62bffb87c16">OCI_GetResultset</a>(st);</div>
<div class="line"></div>
<div class="line">    <span class="keywordflow">while</span> (<a class="code" href="group___ocilib_c_api_fetching.html#ga36ac26dcea78f6074421781e401f97ba">OCI_FetchNext</a>(rs))</div>
<div class="line">    {</div>
<div class="line">        <span class="keyword">const</span> otext *long_str = <a class="code" href="group___ocilib_c_api_fetching.html#ga2a3252984f674fab5358c94d58c689b2">OCI_GetString</a>(rs, 1);</div>
<div class="line"></div>
<div class="line">        print_ostr(long_str);</div>
<div class="line">        print_frmt(<span class="stringliteral">&quot;\n%d bytes read\n&quot;</span>, (<span class="keywordtype">int</span>) ostrlen(long_str));</div>
<div class="line">    }</div>
<div class="line"></div>
<div class="line">    print_frmt(<span class="stringliteral">&quot;\n%u row(s) fetched\n&quot;</span>, <a class="code" href="group___ocilib_c_api_fetching.html#ga93bd9197720088dbda2bef593ad1c07c">OCI_GetRowCount</a>(rs));</div>
<div class="line">}</div>
<div class="line"></div>
<div class="line"><span class="comment">/* --------------------------------------------------------------------------------------------- *</span></div>
<div class="line"><span class="comment"> * test_lob</span></div>
<div class="line"><span class="comment"> * --------------------------------------------------------------------------------------------- */</span></div>
<div class="line"></div>
<div class="line"><span class="keywordtype">void</span> test_lob(<span class="keywordtype">void</span>)</div>
<div class="line">{</div>
<div class="line">    <a class="code" href="group___ocilib_c_api_datatypes.html#ga8b274b67a4c2320612d4dfb3083131f5">OCI_Lob</a> *lob;</div>
<div class="line"></div>
<div class="line">    print_text(<span class="stringliteral">&quot;\n&gt;&gt;&gt;&gt;&gt; TEST LOB MANIPULATION\n\n&quot;</span>);</div>
<div class="line"></div>
<div class="line">    <a class="code" href="group___ocilib_c_api_statements.html#ga8b2b66994f847d9f0b6b0efe4a13ccf3">OCI_ExecuteStmt</a>(st, OTEXT(<span class="stringliteral">&quot;select code, content from test_lob &quot;</span>)</div>
<div class="line">                        OTEXT(<span class="stringliteral">&quot;where code=1 for update&quot;</span>));</div>
<div class="line"></div>
<div class="line">    rs = <a class="code" href="group___ocilib_c_api_fetching.html#gaf2a9e28b66a9538ba0ffb62bffb87c16">OCI_GetResultset</a>(st);</div>
<div class="line"></div>
<div class="line">    <span class="keywordflow">while</span> (<a class="code" href="group___ocilib_c_api_fetching.html#ga36ac26dcea78f6074421781e401f97ba">OCI_FetchNext</a>(rs))</div>
<div class="line">    {</div>
<div class="line">        lob  = <a class="code" href="group___ocilib_c_api_fetching.html#gabac23a7dea02963ef8de438950ef6fae">OCI_GetLob</a>(rs, 2);</div>
<div class="line"></div>
<div class="line">        <a class="code" href="group___ocilib_c_api_lobs.html#ga949f7050609430486c9ef0f3c488d38a">OCI_LobWrite</a>(lob, OTEXT(<span class="stringliteral">&quot;today, &quot;</span>), 7);</div>
<div class="line">        <a class="code" href="group___ocilib_c_api_lobs.html#ga7bfac772587753b2cef9c5a704ae7ce9">OCI_LobAppend</a>(lob, OTEXT(<span class="stringliteral">&quot;i&#39;m going to the cinema ! &quot;</span>), 26);</div>
<div class="line">        <a class="code" href="group___ocilib_c_api_lobs.html#ga63df7f944c418642fc04571a4a522b87">OCI_LobSeek</a>(lob, 0, OCI_SEEK_SET);</div>
<div class="line"></div>
<div class="line">        temp[<a class="code" href="group___ocilib_c_api_lobs.html#ga36708313dc7d5c0b2c30f7f8b9fa2e2d">OCI_LobRead</a>(lob, temp, SIZE_STR)] = 0;</div>
<div class="line"></div>
<div class="line">        print_frmt(<span class="stringliteral">&quot;&gt; code    : %i&quot;</span>, <a class="code" href="group___ocilib_c_api_fetching.html#gaa8d80dc30b2012eaddd13efa9dfb711d">OCI_GetInt</a>(rs, 1));</div>
<div class="line">        print_text(<span class="stringliteral">&quot;, content : &quot;</span>); print_ostr(temp);</div>
<div class="line">        print_text(<span class="stringliteral">&quot;\n&quot;</span>);</div>
<div class="line">    }</div>
<div class="line"></div>
<div class="line">    <a class="code" href="group___ocilib_c_api_transactions.html#gaee1ba614ed2dc5bd83bf788ca08f3e71">OCI_Commit</a>(cn);</div>
<div class="line"></div>
<div class="line">    print_frmt(<span class="stringliteral">&quot;\n%u row(s) fetched\n&quot;</span>, <a class="code" href="group___ocilib_c_api_fetching.html#ga93bd9197720088dbda2bef593ad1c07c">OCI_GetRowCount</a>(rs));</div>
<div class="line">}</div>
<div class="line"></div>
<div class="line"><span class="comment">/* --------------------------------------------------------------------------------------------- *</span></div>
<div class="line"><span class="comment"> * test_nested_table</span></div>
<div class="line"><span class="comment"> * --------------------------------------------------------------------------------------------- */</span></div>
<div class="line"></div>
<div class="line"><span class="keywordtype">void</span> test_nested_table(<span class="keywordtype">void</span>)</div>
<div class="line">{</div>
<div class="line">    print_text(<span class="stringliteral">&quot;\n&gt;&gt;&gt;&gt;&gt; TEST NESTED TABLE \n\n&quot;</span>);</div>
<div class="line"></div>
<div class="line">    <a class="code" href="group___ocilib_c_api_statements.html#ga8b2b66994f847d9f0b6b0efe4a13ccf3">OCI_ExecuteStmt</a>(st, OTEXT(<span class="stringliteral">&quot;select article, cursor(select sysdate &quot;</span>)</div>
<div class="line">                        OTEXT(<span class="stringliteral">&quot;from dual) from test_fetch&quot;</span>));</div>
<div class="line"></div>
<div class="line">    rs = <a class="code" href="group___ocilib_c_api_fetching.html#gaf2a9e28b66a9538ba0ffb62bffb87c16">OCI_GetResultset</a>(st);</div>
<div class="line"></div>
<div class="line">    <span class="keywordflow">while</span> (<a class="code" href="group___ocilib_c_api_fetching.html#ga36ac26dcea78f6074421781e401f97ba">OCI_FetchNext</a>(rs))</div>
<div class="line">    {</div>
<div class="line">        <a class="code" href="group___ocilib_c_api_datatypes.html#ga4b016f1bd7de508b1a919e34b12aa83d">OCI_Statement</a> *st2 = <a class="code" href="group___ocilib_c_api_fetching.html#ga9b73fe347ad581a6493845e6d0c3d04d">OCI_GetStatement</a>(rs, 2);</div>
<div class="line">        <a class="code" href="group___ocilib_c_api_datatypes.html#gae0c7aa9c507975d21ca6c261081ba753">OCI_Resultset</a> *rs2 = <a class="code" href="group___ocilib_c_api_fetching.html#gaf2a9e28b66a9538ba0ffb62bffb87c16">OCI_GetResultset</a>(st2);</div>
<div class="line"></div>
<div class="line">        <span class="keywordflow">while</span> (<a class="code" href="group___ocilib_c_api_fetching.html#ga36ac26dcea78f6074421781e401f97ba">OCI_FetchNext</a>(rs2))</div>
<div class="line">        {</div>
<div class="line">            print_text(<span class="stringliteral">&quot;&gt; article : &quot;</span>); print_ostr(<a class="code" href="group___ocilib_c_api_fetching.html#ga2a3252984f674fab5358c94d58c689b2">OCI_GetString</a>(rs, 1));</div>
<div class="line">            print_text(<span class="stringliteral">&quot;, date : &quot;</span>);    print_ostr(<a class="code" href="group___ocilib_c_api_fetching.html#ga2a3252984f674fab5358c94d58c689b2">OCI_GetString</a>(rs2, 1));</div>
<div class="line">            print_text(<span class="stringliteral">&quot;\n&quot;</span>);</div>
<div class="line">        }</div>
<div class="line">    }</div>
<div class="line">}</div>
<div class="line"></div>
<div class="line"><span class="comment">/* --------------------------------------------------------------------------------------------- *</span></div>
<div class="line"><span class="comment"> * test_ref_cursor</span></div>
<div class="line"><span class="comment"> * --------------------------------------------------------------------------------------------- */</span></div>
<div class="line"></div>
<div class="line"><span class="keywordtype">void</span> test_ref_cursor(<span class="keywordtype">void</span>)</div>
<div class="line">{</div>
<div class="line">    <a class="code" href="group___ocilib_c_api_datatypes.html#ga4b016f1bd7de508b1a919e34b12aa83d">OCI_Statement</a>* st2 = <a class="code" href="group___ocilib_c_api_statements.html#ga335822f983af0fb5c529431f06a9a17b">OCI_StatementCreate</a>(cn);</div>
<div class="line"></div>
<div class="line">    print_text(<span class="stringliteral">&quot;\n&gt;&gt;&gt;&gt;&gt; TEST REF CURSOR \n\n&quot;</span>);</div>
<div class="line"></div>
<div class="line">    <a class="code" href="group___ocilib_c_api_statements.html#ga592e4b3cf3df7e152c46fab5d6e3b3af">OCI_Prepare</a>(st, OTEXT(<span class="stringliteral">&quot;begin open :c for select * from test_fetch; end;&quot;</span>));</div>
<div class="line">    <a class="code" href="group___ocilib_c_api_binding.html#ga3b14174ebbbf8086e01d5120f9db0676">OCI_BindStatement</a>(st, OTEXT(<span class="stringliteral">&quot;:c&quot;</span>), st2);</div>
<div class="line">    <a class="code" href="group___ocilib_c_api_statements.html#ga7189aa353845909aaedc8d5956429450">OCI_Execute</a>(st);</div>
<div class="line"></div>
<div class="line">    rs = <a class="code" href="group___ocilib_c_api_fetching.html#gaf2a9e28b66a9538ba0ffb62bffb87c16">OCI_GetResultset</a>(st2);</div>
<div class="line"></div>
<div class="line">    <span class="comment">/* print resultset content */</span></div>
<div class="line">    <span class="keywordflow">while</span> (<a class="code" href="group___ocilib_c_api_fetching.html#ga36ac26dcea78f6074421781e401f97ba">OCI_FetchNext</a>(rs))</div>
<div class="line">    {</div>
<div class="line">        print_frmt(<span class="stringliteral">&quot;&gt; code : %i&quot;</span>, <a class="code" href="group___ocilib_c_api_fetching.html#gaa8d80dc30b2012eaddd13efa9dfb711d">OCI_GetInt</a>(rs, 1));</div>
<div class="line">        print_text(<span class="stringliteral">&quot;, action : &quot;</span>); print_ostr(<a class="code" href="group___ocilib_c_api_fetching.html#ga2a3252984f674fab5358c94d58c689b2">OCI_GetString</a>(rs, 2));</div>
<div class="line">        print_frmt(<span class="stringliteral">&quot;, price : %g&quot;</span>, <a class="code" href="group___ocilib_c_api_fetching.html#gadfbe8b6c23200810823e9ca6a1956cd7">OCI_GetDouble</a>(rs,3));</div>
<div class="line">        print_text(<span class="stringliteral">&quot;, date : &quot;</span>); print_ostr(<a class="code" href="group___ocilib_c_api_fetching.html#ga2a3252984f674fab5358c94d58c689b2">OCI_GetString</a>(rs, 4));</div>
<div class="line">        print_text(<span class="stringliteral">&quot;\n&quot;</span>);</div>
<div class="line">    }</div>
<div class="line"></div>
<div class="line">    print_frmt(<span class="stringliteral">&quot;\n%u row(s) fetched\n&quot;</span>, <a class="code" href="group___ocilib_c_api_fetching.html#ga93bd9197720088dbda2bef593ad1c07c">OCI_GetRowCount</a>(rs));</div>
<div class="line"></div>
<div class="line">    <a class="code" href="group___ocilib_c_api_statements.html#ga487b4f90f1fd4aee18f3d901f5aed104">OCI_StatementFree</a>(st2);</div>
<div class="line">}</div>
<div class="line"></div>
<div class="line"><span class="comment">/* --------------------------------------------------------------------------------------------- *</span></div>
<div class="line"><span class="comment"> * test_plsql</span></div>
<div class="line"><span class="comment"> * --------------------------------------------------------------------------------------------- */</span></div>
<div class="line"></div>
<div class="line"><span class="keywordtype">void</span> test_plsql(<span class="keywordtype">void</span>)</div>
<div class="line">{</div>
<div class="line">    <span class="keywordtype">int</span> res = 0;</div>
<div class="line">    <span class="keyword">const</span> otext *p=NULL;</div>
<div class="line"></div>
<div class="line">    print_text(<span class="stringliteral">&quot;\n&gt;&gt;&gt;&gt;&gt; TEST PL/SQL OUTPUT BIND\n\n&quot;</span>);</div>
<div class="line"></div>
<div class="line">    <a class="code" href="group___ocilib_c_api_statements.html#ga592e4b3cf3df7e152c46fab5d6e3b3af">OCI_Prepare</a>(st, OTEXT(<span class="stringliteral">&quot;begin :res := trunc(sysdate+1)-trunc(sysdate-1); end;&quot;</span>));</div>
<div class="line">    <a class="code" href="group___ocilib_c_api_binding.html#gab0be696e4216d8573dd75ed29b4979e3">OCI_BindInt</a>(st, OTEXT(<span class="stringliteral">&quot;:res&quot;</span>), &amp;res);</div>
<div class="line">    <a class="code" href="group___ocilib_c_api_statements.html#ga7189aa353845909aaedc8d5956429450">OCI_Execute</a>(st);</div>
<div class="line"></div>
<div class="line">    print_text(<span class="stringliteral">&quot;\nPL/SQL : trunc(sysdate+1)-trunc(sysdate-1)\n&quot;</span>);</div>
<div class="line">    print_frmt(<span class="stringliteral">&quot;\nResult : %i\n&quot;</span>, res);</div>
<div class="line"></div>
<div class="line"><span class="preprocessor">#ifndef OCI_CHARSET_ANSI</span></div>
<div class="line"></div>
<div class="line">    {</div>
<div class="line">        <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> version = <a class="code" href="group___ocilib_c_api_initialization.html#ga771bf5d33dbd0b63d84242819209b35b">OCI_GetOCIRuntimeVersion</a>();</div>
<div class="line"></div>
<div class="line">        <span class="comment">/* Oracle 8i has some troubles with SERVER OUTPUT in unicode */</span></div>
<div class="line"></div>
<div class="line">        <span class="keywordflow">if</span> (version &lt; OCI_9_0) </div>
<div class="line">            <span class="keywordflow">return</span>;</div>
<div class="line">    }</div>
<div class="line"></div>
<div class="line"><span class="preprocessor">#endif</span></div>
<div class="line"></div>
<div class="line">    print_text(<span class="stringliteral">&quot;\n&gt;&gt;&gt;&gt;&gt; TEST PL/SQL SERVER OUTPUT\n\n&quot;</span>);</div>
<div class="line"></div>
<div class="line">    <span class="comment">/* server output */</span></div>
<div class="line"></div>
<div class="line">    <a class="code" href="group___ocilib_c_api_pl_sql.html#gaeff8f38ba15b9e757cec70d91e4ffe13">OCI_ServerEnableOutput</a>(cn, 32000, 5, 255);</div>
<div class="line"></div>
<div class="line">    <a class="code" href="group___ocilib_c_api_statements.html#ga8b2b66994f847d9f0b6b0efe4a13ccf3">OCI_ExecuteStmt</a>(st, OTEXT(<span class="stringliteral">&quot;begin &quot;</span>)</div>
<div class="line">                        OTEXT(<span class="stringliteral">&quot;   dbms_output.put_line(&#39;First  line&#39;); &quot;</span>)</div>
<div class="line">                        OTEXT(<span class="stringliteral">&quot;   dbms_output.put_line(&#39;Second line&#39;); &quot;</span>)</div>
<div class="line">                        OTEXT(<span class="stringliteral">&quot;   dbms_output.put_line(&#39;Third  line&#39;); &quot;</span>)</div>
<div class="line">                        OTEXT(<span class="stringliteral">&quot;end;&quot;</span>)</div>
<div class="line">                   );</div>
<div class="line"></div>
<div class="line">    <span class="keywordflow">while</span> ((p = <a class="code" href="group___ocilib_c_api_pl_sql.html#gaac2621ca13cc7a4e862ae8d93493f684">OCI_ServerGetOutput</a>(cn)))</div>
<div class="line">    {</div>
<div class="line">        print_ostr(p);</div>
<div class="line">        print_text(<span class="stringliteral">&quot;\n&quot;</span>);</div>
<div class="line">    }</div>
<div class="line"></div>
<div class="line">    <a class="code" href="group___ocilib_c_api_pl_sql.html#ga0d3321a0abff0722baf6b2b7233f4cb5">OCI_ServerDisableOutput</a>(cn);</div>
<div class="line">}</div>
<div class="line"></div>
<div class="line"><span class="comment">/* --------------------------------------------------------------------------------------------- *</span></div>
<div class="line"><span class="comment"> * test_dates</span></div>
<div class="line"><span class="comment"> * --------------------------------------------------------------------------------------------- */</span></div>
<div class="line"></div>
<div class="line"><span class="keywordtype">void</span> test_dates(<span class="keywordtype">void</span>)</div>
<div class="line">{</div>
<div class="line">    <a class="code" href="group___ocilib_c_api_datatypes.html#ga549efec5df4c0825db908a5ceb9ab614">OCI_Date</a> *date, *date2;</div>
<div class="line"></div>
<div class="line">    print_text(<span class="stringliteral">&quot;\n&gt;&gt;&gt;&gt;&gt; TEST DATETIME MANIPULATION\n\n&quot;</span>);</div>
<div class="line"></div>
<div class="line">    date  = <a class="code" href="group___ocilib_c_api_datetimes.html#gae80eacef54641a68c3b82be85f4a5042">OCI_DateCreate</a>(NULL);</div>
<div class="line">    date2 = <a class="code" href="group___ocilib_c_api_datetimes.html#gae80eacef54641a68c3b82be85f4a5042">OCI_DateCreate</a>(NULL);</div>
<div class="line"></div>
<div class="line">    <a class="code" href="group___ocilib_c_api_datetimes.html#ga412dea1ba595fcbc293ee278f1ff04ab">OCI_DateFromText</a>(date, OTEXT(<span class="stringliteral">&quot;1978-04-13 20:20:12&quot;</span>), OTEXT(<span class="stringliteral">&quot;YYYY-MM-DD HH24:MI:SS&quot;</span>));</div>
<div class="line">    <a class="code" href="group___ocilib_c_api_datetimes.html#gaca5b7b09eae70235fa9c068a7a6df971">OCI_DateToText</a>(date, OTEXT(<span class="stringliteral">&quot;YYYY-MM-DD HH24:MI:SS&quot;</span>), SIZE_STR, str);</div>
<div class="line">    print_text(<span class="stringliteral">&quot;\nDate                     : &quot;</span>); print_ostr(str);</div>
<div class="line"></div>
<div class="line">    <a class="code" href="group___ocilib_c_api_datetimes.html#gad7c5c65d88b52e6ecb46b3e9ba8843dc">OCI_DateSysDate</a>(date);</div>
<div class="line">    <a class="code" href="group___ocilib_c_api_datetimes.html#gaca5b7b09eae70235fa9c068a7a6df971">OCI_DateToText</a>(date, OTEXT(<span class="stringliteral">&quot;YYYY-MM-DD HH24:MI:SS&quot;</span>), SIZE_STR, str);</div>
<div class="line">    print_text(<span class="stringliteral">&quot;\nSysdate                  : &quot;</span>); print_ostr(str);</div>
<div class="line"></div>
<div class="line">    <a class="code" href="group___ocilib_c_api_datetimes.html#ga7f446c4dc922920c36601770e3d9d7d1">OCI_DateAddDays</a>(date, 5);</div>
<div class="line">    <a class="code" href="group___ocilib_c_api_datetimes.html#gaa405c4bb8c705ce2dd03b51bba1ef303">OCI_DateAddMonths</a>(date, 2);</div>
<div class="line">    <a class="code" href="group___ocilib_c_api_datetimes.html#gaca5b7b09eae70235fa9c068a7a6df971">OCI_DateToText</a>(date, OTEXT(<span class="stringliteral">&quot;YYYY-MM-DD HH24:MI:SS&quot;</span>), SIZE_STR, str);</div>
<div class="line">    print_text(<span class="stringliteral">&quot;\nDate + 5 days + 2 months : &quot;</span>); print_ostr(str);</div>
<div class="line"></div>
<div class="line">    <a class="code" href="group___ocilib_c_api_datetimes.html#gad66b48f587f3bc30b1db8cd4cb892847">OCI_DateAssign</a>(date2, date);</div>
<div class="line">    <a class="code" href="group___ocilib_c_api_datetimes.html#ga0d174f4b5db6961053807efe1698ea81">OCI_DateLastDay</a>(date);</div>
<div class="line">    <a class="code" href="group___ocilib_c_api_datetimes.html#gaca5b7b09eae70235fa9c068a7a6df971">OCI_DateToText</a>(date, OTEXT(<span class="stringliteral">&quot;YYYY-MM-DD&quot;</span>), SIZE_STR, str);</div>
<div class="line">    print_text(<span class="stringliteral">&quot;\nLast day of the month    : &quot;</span>); print_ostr(str);</div>
<div class="line"></div>
<div class="line">    print_frmt(<span class="stringliteral">&quot;\nEnd of the month - date  : %i days&quot;</span>,</div>
<div class="line">               <a class="code" href="group___ocilib_c_api_datetimes.html#gafa9f51e0977278bc43dafdef13d7fb5e">OCI_DateDaysBetween</a>(date, date2));</div>
<div class="line">    print_text(<span class="stringliteral">&quot;\n&quot;</span>);</div>
<div class="line"></div>
<div class="line">    <a class="code" href="group___ocilib_c_api_datetimes.html#gaedf77cfe4bd5dab7909e4c2fb5173b48">OCI_DateFree</a>(date);</div>
<div class="line">    <a class="code" href="group___ocilib_c_api_datetimes.html#gaedf77cfe4bd5dab7909e4c2fb5173b48">OCI_DateFree</a>(date2);</div>
<div class="line">}</div>
<div class="line"></div>
<div class="line"><span class="comment">/* --------------------------------------------------------------------------------------------- *</span></div>
<div class="line"><span class="comment"> * test_timestamp</span></div>
<div class="line"><span class="comment"> * --------------------------------------------------------------------------------------------- */</span></div>
<div class="line"></div>
<div class="line"><span class="keywordtype">void</span> test_timestamp(<span class="keywordtype">void</span>)</div>
<div class="line">{</div>
<div class="line"><span class="preprocessor">#ifndef OCI_CHARSET_ANSI</span></div>
<div class="line"></div>
<div class="line">    <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> version = <a class="code" href="group___ocilib_c_api_initialization.html#ga771bf5d33dbd0b63d84242819209b35b">OCI_GetOCIRuntimeVersion</a>();</div>
<div class="line"></div>
<div class="line">    <span class="comment">/* Oracle 9i has some troubles with formatting Intervals/timestamps in</span></div>
<div class="line"><span class="comment">       an UTF16 context... */</span></div>
<div class="line"></div>
<div class="line">    <span class="keywordflow">if</span> ((version &gt;= OCI_9_0) || (version &lt; OCI_10_1))</div>
<div class="line">        <span class="keywordflow">return</span>;</div>
<div class="line"><span class="preprocessor">#endif</span></div>
<div class="line"></div>
<div class="line">    <span class="keywordflow">if</span> (<a class="code" href="group___ocilib_c_api_initialization.html#ga771bf5d33dbd0b63d84242819209b35b">OCI_GetOCIRuntimeVersion</a>() &gt;= OCI_9_0)</div>
<div class="line">    {</div>
<div class="line">        <a class="code" href="group___ocilib_c_api_datatypes.html#ga51bd3b406fe1b1d1a2eceee3f02ebd47">OCI_Timestamp</a> *tmsp;</div>
<div class="line"></div>
<div class="line">        print_text(<span class="stringliteral">&quot;\n&gt;&gt;&gt;&gt;&gt; TEST TIMESTAMP\n\n&quot;</span>);</div>
<div class="line"></div>
<div class="line">        tmsp = <a class="code" href="group___ocilib_c_api_timestamps.html#ga5c590ea371920703997cd7bea126ad9d">OCI_TimestampCreate</a>(NULL, OCI_TIMESTAMP);</div>
<div class="line"></div>
<div class="line">        OCI_TimestampSysTimeStamp(tmsp);</div>
<div class="line"></div>
<div class="line">        <a class="code" href="group___ocilib_c_api_timestamps.html#gaa03bff2809c77cfa152c18aca8f12ea0">OCI_TimestampToText</a>(tmsp, OTEXT(<span class="stringliteral">&quot;YYYY-MM-DD HH24:MI:SS:FF\n&quot;</span>), SIZE_STR, str, 3);</div>
<div class="line"></div>
<div class="line"></div>
<div class="line">        print_text(<span class="stringliteral">&quot;Current timestamp            : &quot;</span>); print_ostr(str);</div>
<div class="line"></div>
<div class="line">        <span class="comment">/* intervals raw oci functions have some troubles with Oracle 9i. So let&#39;s</span></div>
<div class="line"><span class="comment">           use it for the demo only if we&#39;re using 10g or above */</span></div>
<div class="line"></div>
<div class="line">        <span class="keywordflow">if</span> (<a class="code" href="group___ocilib_c_api_initialization.html#ga771bf5d33dbd0b63d84242819209b35b">OCI_GetOCIRuntimeVersion</a>() &gt;= OCI_10_1)</div>
<div class="line">        {</div>
<div class="line">            <a class="code" href="group___ocilib_c_api_datatypes.html#gac15e42323f4e24403bb2ff5dce7e054c">OCI_Interval</a> *itv;</div>
<div class="line"></div>
<div class="line">            print_text(<span class="stringliteral">&quot;\n&gt;&gt;&gt;&gt;&gt; TEST INTERVAL \n\n&quot;</span>);</div>
<div class="line"></div>
<div class="line">            itv = <a class="code" href="group___ocilib_c_api_timestamps.html#ga4748278cf01c5e927137ce3342038fd7">OCI_IntervalCreate</a>(NULL, OCI_INTERVAL_DS);</div>
<div class="line"></div>
<div class="line">            <a class="code" href="group___ocilib_c_api_timestamps.html#ga5fa498aad5bf6a1b2bd899a0f054432a">OCI_IntervalSetDaySecond</a>(itv, 1,1,1,1,0);</div>
<div class="line"></div>
<div class="line">            <a class="code" href="group___ocilib_c_api_timestamps.html#ga082b6dd7a028234b87c3e7efc94fe598">OCI_IntervalToText</a>(itv, 3, 3, SIZE_STR, str);</div>
<div class="line"></div>
<div class="line">            print_text(<span class="stringliteral">&quot;Interval                     : &quot;</span>); print_ostr(str);</div>
<div class="line">            print_text(<span class="stringliteral">&quot;\n&quot;</span>);</div>
<div class="line"></div>
<div class="line">            <a class="code" href="group___ocilib_c_api_timestamps.html#ga43028a0463f25bcd9665993a244572e7">OCI_TimestampIntervalAdd</a>(tmsp, itv);</div>
<div class="line"></div>
<div class="line">            <a class="code" href="group___ocilib_c_api_timestamps.html#gaa03bff2809c77cfa152c18aca8f12ea0">OCI_TimestampToText</a>(tmsp, OTEXT(<span class="stringliteral">&quot;YYYY-MM-DD HH24:MI:SS:FF\n&quot;</span>), SIZE_STR, str, 3);</div>
<div class="line"></div>
<div class="line">            print_text(<span class="stringliteral">&quot;Current timestamp + Interval : &quot;</span>); print_ostr(str);</div>
<div class="line"></div>
<div class="line">            <a class="code" href="group___ocilib_c_api_timestamps.html#ga7623b368ab3486c15c6d671054fac3e3">OCI_IntervalFree</a>(itv);</div>
<div class="line">        }</div>
<div class="line"></div>
<div class="line">        <a class="code" href="group___ocilib_c_api_timestamps.html#ga60e9851db1175d6b650f9df00db274da">OCI_TimestampFree</a>(tmsp);</div>
<div class="line">    }</div>
<div class="line">}</div>
<div class="line"></div>
<div class="line"><span class="comment">/* --------------------------------------------------------------------------------------------- *</span></div>
<div class="line"><span class="comment"> * test_describe</span></div>
<div class="line"><span class="comment"> * --------------------------------------------------------------------------------------------- */</span></div>
<div class="line"></div>
<div class="line"><span class="keywordtype">void</span> test_describe(<span class="keywordtype">void</span>)</div>
<div class="line">{</div>
<div class="line">    <a class="code" href="group___ocilib_c_api_datatypes.html#gac0a3096f1a717d9417d9639e6da7dc56">OCI_Column</a>   *col;</div>
<div class="line">    <a class="code" href="group___ocilib_c_api_datatypes.html#gad33099e82262f1f484c19283d5f812c6">OCI_TypeInfo</a> *tbl;</div>
<div class="line"></div>
<div class="line">    <span class="keywordtype">int</span> i, n;</div>
<div class="line"></div>
<div class="line">    print_text(<span class="stringliteral">&quot;\n&gt;&gt;&gt;&gt;&gt; TEST DESCRIBING TABLE \n\n&quot;</span>);</div>
<div class="line"></div>
<div class="line">    tbl = <a class="code" href="group___ocilib_c_api_metadata.html#ga541bb34a0a86c6296f59605f85931039">OCI_TypeInfoGet</a>(cn, OTEXT(<span class="stringliteral">&quot;test_fetch&quot;</span>), OCI_TIF_TABLE);</div>
<div class="line"></div>
<div class="line">    <span class="keywordflow">if</span> (tbl)</div>
<div class="line">    {</div>
<div class="line">        print_text(<span class="stringliteral">&quot;Column Name         NULL ?  Type                        \n&quot;</span>);</div>
<div class="line">        print_text(<span class="stringliteral">&quot;--------------------------------------------------------\n&quot;</span>);</div>
<div class="line"></div>
<div class="line">        n = <a class="code" href="group___ocilib_c_api_metadata.html#ga9c93a72421d19de30acbf05a53353c93">OCI_TypeInfoGetColumnCount</a>(tbl);</div>
<div class="line"></div>
<div class="line">        <span class="keywordflow">for</span>(i = 1; i &lt;= n; i++)</div>
<div class="line">        {</div>
<div class="line">            col = <a class="code" href="group___ocilib_c_api_metadata.html#gab22a6fcb3d64c74adfc7506f1ce343d7">OCI_TypeInfoGetColumn</a>(tbl, i);</div>
<div class="line"></div>
<div class="line">            <a class="code" href="group___ocilib_c_api_fetching.html#ga0dba8f75ffad97cbeec1464bc5d4cc48">OCI_ColumnGetFullSQLType</a>(col, str, SIZE_STR);</div>
<div class="line"></div>
<div class="line"><span class="preprocessor">#if defined(OCI_CHARSET_WIDE)</span></div>
<div class="line"><span class="preprocessor">  #if !defined(_WINDOWS)</span></div>
<div class="line">            printf(<span class="stringliteral">&quot;%-20ls%-8ls%-30ls\n&quot;</span>,</div>
<div class="line">  #<span class="keywordflow">else</span></div>
<div class="line">            wprintf(OTEXT(<span class="stringliteral">&quot;%-20s%-8s%-30s\n&quot;</span>),</div>
<div class="line">  #endif</div>
<div class="line">#<span class="keywordflow">else</span></div>
<div class="line">            printf(<span class="stringliteral">&quot;%-20s%-8s%-30s\n&quot;</span>,</div>
<div class="line">#endif</div>
<div class="line">                    <a class="code" href="group___ocilib_c_api_fetching.html#ga9838be3f2abccc13a01bd395b2ae5121">OCI_ColumnGetName</a>(col),</div>
<div class="line">                    <a class="code" href="group___ocilib_c_api_fetching.html#ga741f0a6b17d20da49772c564bf2657cd">OCI_ColumnGetNullable</a>(col) == TRUE ? OTEXT(<span class="stringliteral">&quot;Y&quot;</span>) : OTEXT(<span class="stringliteral">&quot;N&quot;</span>),</div>
<div class="line">                    str);</div>
<div class="line">        }</div>
<div class="line">    }</div>
<div class="line"></div>
<div class="line">    <a class="code" href="group___ocilib_c_api_metadata.html#ga5d8b11bf30702727e7c0499875ab9142">OCI_TypeInfoFree</a>(tbl);</div>
<div class="line"></div>
<div class="line">    <span class="comment">/* TEST DESCRIBING TYPE ------------------------------------------------- */</span></div>
<div class="line"></div>
<div class="line">    print_text(<span class="stringliteral">&quot;\n&gt;&gt;&gt;&gt;&gt; TEST DESCRIBING TYPE \n\n&quot;</span>);</div>
<div class="line"></div>
<div class="line">    tbl = <a class="code" href="group___ocilib_c_api_metadata.html#ga541bb34a0a86c6296f59605f85931039">OCI_TypeInfoGet</a>(cn, OTEXT(<span class="stringliteral">&quot;test_t&quot;</span>), OCI_TIF_TYPE);</div>
<div class="line"></div>
<div class="line">    <span class="keywordflow">if</span> (tbl)</div>
<div class="line">    {</div>
<div class="line">        print_text(<span class="stringliteral">&quot;Column Name         Type                           \n&quot;</span>);</div>
<div class="line">        print_text(<span class="stringliteral">&quot;---------------------------------------------------\n&quot;</span>);</div>
<div class="line"></div>
<div class="line">        n = <a class="code" href="group___ocilib_c_api_metadata.html#ga9c93a72421d19de30acbf05a53353c93">OCI_TypeInfoGetColumnCount</a>(tbl);</div>
<div class="line"></div>
<div class="line">        <span class="keywordflow">for</span>(i = 1; i &lt;= n; i++)</div>
<div class="line">        {</div>
<div class="line">            col = <a class="code" href="group___ocilib_c_api_metadata.html#gab22a6fcb3d64c74adfc7506f1ce343d7">OCI_TypeInfoGetColumn</a>(tbl, i);</div>
<div class="line"></div>
<div class="line">            <a class="code" href="group___ocilib_c_api_fetching.html#ga0dba8f75ffad97cbeec1464bc5d4cc48">OCI_ColumnGetFullSQLType</a>(col, str, SIZE_STR);</div>
<div class="line"></div>
<div class="line"><span class="preprocessor">#if defined(OCI_CHARSET_WIDE)</span></div>
<div class="line"><span class="preprocessor">  #if !defined(_WINDOWS)</span></div>
<div class="line">            printf(<span class="stringliteral">&quot;%-20ls%-30ls\n&quot;</span>,</div>
<div class="line">  #<span class="keywordflow">else</span></div>
<div class="line">            wprintf(OTEXT(<span class="stringliteral">&quot;%-20s%-30s\n&quot;</span>),</div>
<div class="line">  #endif</div>
<div class="line">#<span class="keywordflow">else</span></div>
<div class="line">            printf(<span class="stringliteral">&quot;%-20s%-30s\n&quot;</span>,</div>
<div class="line">#endif</div>
<div class="line">                    <a class="code" href="group___ocilib_c_api_fetching.html#ga9838be3f2abccc13a01bd395b2ae5121">OCI_ColumnGetName</a>(col),  str);</div>
<div class="line">        }</div>
<div class="line">    }</div>
<div class="line"></div>
<div class="line">    <a class="code" href="group___ocilib_c_api_metadata.html#ga5d8b11bf30702727e7c0499875ab9142">OCI_TypeInfoFree</a>(tbl);</div>
<div class="line">}</div>
<div class="line"></div>
<div class="line"><span class="comment">/* --------------------------------------------------------------------------------------------- *</span></div>
<div class="line"><span class="comment"> * test_returning</span></div>
<div class="line"><span class="comment"> * --------------------------------------------------------------------------------------------- */</span></div>
<div class="line"></div>
<div class="line"><span class="keywordtype">void</span> test_returning(<span class="keywordtype">void</span>)</div>
<div class="line">{</div>
<div class="line">    <a class="code" href="group___ocilib_c_api_datatypes.html#ga8b274b67a4c2320612d4dfb3083131f5">OCI_Lob</a> *lob;</div>
<div class="line"></div>
<div class="line">    print_text(<span class="stringliteral">&quot;\n&gt;&gt;&gt;&gt;&gt; TEST RETURNING CLAUSE \n\n&quot;</span>);</div>
<div class="line"></div>
<div class="line">    <a class="code" href="group___ocilib_c_api_statements.html#ga592e4b3cf3df7e152c46fab5d6e3b3af">OCI_Prepare</a>(st, OTEXT(<span class="stringliteral">&quot;update test_lob set code = code + 1 returning code, content into :i, :l&quot;</span>));</div>
<div class="line">    <a class="code" href="group___ocilib_c_api_feature_returning_into.html#gaaf804e8eb11f4b040e23ce4f164f279c">OCI_RegisterLob</a>(st, OTEXT(<span class="stringliteral">&quot;:l&quot;</span>), OCI_CLOB);</div>
<div class="line">    <a class="code" href="group___ocilib_c_api_feature_returning_into.html#ga4c215f37902cc9045c27ae1bdd3b2844">OCI_RegisterInt</a>(st, OTEXT(<span class="stringliteral">&quot;:i&quot;</span>));</div>
<div class="line">    <a class="code" href="group___ocilib_c_api_statements.html#ga7189aa353845909aaedc8d5956429450">OCI_Execute</a>(st);</div>
<div class="line"></div>
<div class="line">    rs = <a class="code" href="group___ocilib_c_api_fetching.html#gaf2a9e28b66a9538ba0ffb62bffb87c16">OCI_GetResultset</a>(st);</div>
<div class="line"></div>
<div class="line">    <span class="keywordflow">while</span> (<a class="code" href="group___ocilib_c_api_fetching.html#ga36ac26dcea78f6074421781e401f97ba">OCI_FetchNext</a>(rs))</div>
<div class="line">    {</div>
<div class="line">        lob = <a class="code" href="group___ocilib_c_api_fetching.html#gabac23a7dea02963ef8de438950ef6fae">OCI_GetLob</a>(rs, 2);</div>
<div class="line"></div>
<div class="line">        <a class="code" href="group___ocilib_c_api_lobs.html#ga7bfac772587753b2cef9c5a704ae7ce9">OCI_LobAppend</a>(lob, OTEXT(<span class="stringliteral">&quot;(modified)&quot;</span>), 10);</div>
<div class="line">        <a class="code" href="group___ocilib_c_api_lobs.html#ga63df7f944c418642fc04571a4a522b87">OCI_LobSeek</a>(lob, 0, OCI_SEEK_SET);</div>
<div class="line"></div>
<div class="line">        temp[<a class="code" href="group___ocilib_c_api_lobs.html#ga36708313dc7d5c0b2c30f7f8b9fa2e2d">OCI_LobRead</a>(lob, temp, SIZE_STR)] = 0;</div>
<div class="line"></div>
<div class="line">        print_frmt(<span class="stringliteral">&quot;&gt; code : %i - &quot;</span>, <a class="code" href="group___ocilib_c_api_fetching.html#gaa8d80dc30b2012eaddd13efa9dfb711d">OCI_GetInt</a>(rs, 1));</div>
<div class="line">        print_ostr(temp);</div>
<div class="line">        print_text(<span class="stringliteral">&quot;\n&quot;</span>);</div>
<div class="line">   }</div>
<div class="line"></div>
<div class="line">    print_frmt(<span class="stringliteral">&quot;\n%u row(s) fetched\n&quot;</span>, <a class="code" href="group___ocilib_c_api_fetching.html#ga93bd9197720088dbda2bef593ad1c07c">OCI_GetRowCount</a>(rs));</div>
<div class="line"></div>
<div class="line">    <a class="code" href="group___ocilib_c_api_transactions.html#gaee1ba614ed2dc5bd83bf788ca08f3e71">OCI_Commit</a>(cn);</div>
<div class="line">}</div>
<div class="line"></div>
<div class="line"><span class="comment">/* --------------------------------------------------------------------------------------------- *</span></div>
<div class="line"><span class="comment"> * test_returning_array</span></div>
<div class="line"><span class="comment"> * --------------------------------------------------------------------------------------------- */</span></div>
<div class="line"></div>
<div class="line"><span class="keywordtype">void</span> test_returning_array(<span class="keywordtype">void</span>)</div>
<div class="line">{</div>
<div class="line">    <a class="code" href="group___ocilib_c_api_datatypes.html#ga8b274b67a4c2320612d4dfb3083131f5">OCI_Lob</a> *lob;</div>
<div class="line">    <a class="code" href="group___ocilib_c_api_datatypes.html#ga549efec5df4c0825db908a5ceb9ab614">OCI_Date</a> *date;</div>
<div class="line">    <a class="code" href="group___ocilib_c_api_datatypes.html#gad57163fd9169661f31821898c0a86b1d">OCI_File</a> *file;</div>
<div class="line">    <span class="keywordtype">int</span> i;</div>
<div class="line"></div>
<div class="line">    <span class="comment">/* arrays */</span></div>
<div class="line">    <span class="keywordtype">int</span>       tab_int [SIZE_TAB];</div>
<div class="line">    otext     tab_str [SIZE_TAB][31];</div>
<div class="line">    <span class="keywordtype">float</span>     tab_flt [SIZE_TAB];</div>
<div class="line">    <span class="keywordtype">double</span>    tab_dbl [SIZE_TAB];</div>
<div class="line"></div>
<div class="line">    <a class="code" href="group___ocilib_c_api_datatypes.html#ga549efec5df4c0825db908a5ceb9ab614">OCI_Date</a>  **tab_date = <a class="code" href="group___ocilib_c_api_datetimes.html#ga60ba27b663a99d407b837ce665291f03">OCI_DateArrayCreate</a>(cn, SIZE_TAB);</div>
<div class="line">    <a class="code" href="group___ocilib_c_api_datatypes.html#ga8b274b67a4c2320612d4dfb3083131f5">OCI_Lob</a>   **tab_lob  = <a class="code" href="group___ocilib_c_api_lobs.html#ga00934ab657273e10a3dea6c16b32de5f">OCI_LobArrayCreate</a>(cn,  OCI_CLOB, SIZE_TAB);</div>
<div class="line">    <a class="code" href="group___ocilib_c_api_datatypes.html#gad57163fd9169661f31821898c0a86b1d">OCI_File</a>  **tab_file = <a class="code" href="group___ocilib_c_api_files.html#gac74441cd7b3b7fe7e815b4be2fe48c49">OCI_FileArrayCreate</a>(cn, OCI_BFILE, SIZE_TAB);</div>
<div class="line"></div>
<div class="line">    print_text(<span class="stringliteral">&quot;\n&gt;&gt;&gt;&gt;&gt; TEST ARRAY BINDING WITH RETURNING CLAUSE \n\n&quot;</span>);</div>
<div class="line"></div>
<div class="line">    <span class="comment">/* prepare SQL */</span></div>
<div class="line"></div>
<div class="line">    <a class="code" href="group___ocilib_c_api_statements.html#ga592e4b3cf3df7e152c46fab5d6e3b3af">OCI_Prepare</a>(st, OTEXT(<span class="stringliteral">&quot;insert into test_array &quot;</span>)</div>
<div class="line">                    OTEXT(<span class="stringliteral">&quot;( &quot;</span>)</div>
<div class="line">                    OTEXT(<span class="stringliteral">&quot;   val_int,  val_dbl, val_flt, val_str, val_date, &quot;</span>)</div>
<div class="line">                    OTEXT(<span class="stringliteral">&quot;   val_lob, val_file &quot;</span>)</div>
<div class="line">                    OTEXT(<span class="stringliteral">&quot;) &quot;</span> )</div>
<div class="line">                    OTEXT(<span class="stringliteral">&quot;values &quot;</span>)</div>
<div class="line">                    OTEXT(<span class="stringliteral">&quot;( &quot;</span>)</div>
<div class="line">                    OTEXT(<span class="stringliteral">&quot;   :val_int, :val_dbl, :val_flt, :val_str, :val_date, &quot;</span>)</div>
<div class="line">                    OTEXT(<span class="stringliteral">&quot;   :val_lob, :val_file &quot;</span>)</div>
<div class="line">                    OTEXT(<span class="stringliteral">&quot;) &quot;</span>)</div>
<div class="line">                    OTEXT(<span class="stringliteral">&quot;returning&quot;</span>)</div>
<div class="line">                    OTEXT(<span class="stringliteral">&quot;  val_int,  val_dbl, val_flt, val_str, val_date, &quot;</span>)</div>
<div class="line">                    OTEXT(<span class="stringliteral">&quot;   val_lob, val_file &quot;</span>)</div>
<div class="line">                    OTEXT(<span class="stringliteral">&quot;into  &quot;</span> )</div>
<div class="line">                    OTEXT(<span class="stringliteral">&quot;  :out_int, :out_dbl, :out_flt,  :out_str, :out_date, &quot;</span>)</div>
<div class="line">                    OTEXT(<span class="stringliteral">&quot;   :out_lob, :out_file &quot;</span>));</div>
<div class="line"></div>
<div class="line">    <span class="comment">/* Set Array Size */</span></div>
<div class="line"></div>
<div class="line">    <a class="code" href="group___ocilib_c_api_binding.html#ga60d87fbeb94afeaf410ec243eb8c0f98">OCI_BindArraySetSize</a>(st, SIZE_TAB);</div>
<div class="line"></div>
<div class="line">    <span class="comment">/* bind scalar C types arrays */</span></div>
<div class="line"></div>
<div class="line">    <a class="code" href="group___ocilib_c_api_binding.html#ga8d19811edcb1e832086f09d87017a221">OCI_BindArrayOfInts</a>(st, OTEXT(<span class="stringliteral">&quot;:val_int&quot;</span>),  tab_int, 0);</div>
<div class="line">    <a class="code" href="group___ocilib_c_api_binding.html#ga5d8477a5b54bfc4748c6eb52e17fcedf">OCI_BindArrayOfDoubles</a>(st, OTEXT(<span class="stringliteral">&quot;:val_dbl&quot;</span>), tab_dbl, 0);</div>
<div class="line">    <a class="code" href="group___ocilib_c_api_binding.html#ga5a2a36b8455bcf47ee17f8d6b1021cba">OCI_BindArrayOfFloats</a>(st, OTEXT(<span class="stringliteral">&quot;:val_flt&quot;</span>), tab_flt, 0);</div>
<div class="line">    <a class="code" href="group___ocilib_c_api_binding.html#gaeabab17fc82ffa1e7248dce8f0152322">OCI_BindArrayOfStrings</a>(st, OTEXT(<span class="stringliteral">&quot;:val_str&quot;</span>), (otext*) tab_str, 30, 0);</div>
<div class="line"></div>
<div class="line">    <span class="comment">/* bind oracle types arrays */</span></div>
<div class="line"></div>
<div class="line">    <a class="code" href="group___ocilib_c_api_binding.html#gaaadc4ceb7416cfcbd858fd244c3babd4">OCI_BindArrayOfDates</a>(st, OTEXT(<span class="stringliteral">&quot;:val_date&quot;</span>), tab_date, 0);</div>
<div class="line">    <a class="code" href="group___ocilib_c_api_binding.html#ga296a1d0d48327b72d0121f07becb439d">OCI_BindArrayOfLobs</a>(st, OTEXT(<span class="stringliteral">&quot;:val_lob&quot;</span>), tab_lob, OCI_CLOB, 0);</div>
<div class="line">    <a class="code" href="group___ocilib_c_api_binding.html#ga46c3e24c0f2c1445c8eb87363a3d0be5">OCI_BindArrayOfFiles</a>(st, OTEXT(<span class="stringliteral">&quot;:val_file&quot;</span>), tab_file, OCI_BFILE, 0);</div>
<div class="line"></div>
<div class="line">    <span class="comment">/* register C scalar types output */</span></div>
<div class="line"></div>
<div class="line">    <a class="code" href="group___ocilib_c_api_feature_returning_into.html#ga4c215f37902cc9045c27ae1bdd3b2844">OCI_RegisterInt</a>(st, OTEXT(<span class="stringliteral">&quot;:out_int&quot;</span>));</div>
<div class="line">    <a class="code" href="group___ocilib_c_api_feature_returning_into.html#ga47f7026a1340f47106bb68e640721e7b">OCI_RegisterDouble</a>(st, OTEXT(<span class="stringliteral">&quot;:out_dbl&quot;</span>));</div>
<div class="line">    <a class="code" href="group___ocilib_c_api_feature_returning_into.html#ga334374bb86c0562ab453a45a56c62dac">OCI_RegisterFloat</a>(st, OTEXT(<span class="stringliteral">&quot;:out_flt&quot;</span>));</div>
<div class="line">    <a class="code" href="group___ocilib_c_api_feature_returning_into.html#gaf0e8a8475060fc2c352c5ecdf68802ca">OCI_RegisterString</a>(st, OTEXT(<span class="stringliteral">&quot;:out_str&quot;</span>), 30);</div>
<div class="line"></div>
<div class="line">    <span class="comment">/* bind oracle types outputs */</span></div>
<div class="line"></div>
<div class="line">    <a class="code" href="group___ocilib_c_api_feature_returning_into.html#gafefe1c8c8cc0d1ce80017d340900e176">OCI_RegisterDate</a>(st, OTEXT(<span class="stringliteral">&quot;:out_date&quot;</span>));</div>
<div class="line">    <a class="code" href="group___ocilib_c_api_feature_returning_into.html#gaaf804e8eb11f4b040e23ce4f164f279c">OCI_RegisterLob</a>(st, OTEXT(<span class="stringliteral">&quot;:out_lob&quot;</span>), OCI_CLOB);</div>
<div class="line">    <a class="code" href="group___ocilib_c_api_feature_returning_into.html#gaae282a931f8f23e4abe066a9a82ba45f">OCI_RegisterFile</a>(st, OTEXT(<span class="stringliteral">&quot;:out_file&quot;</span>), OCI_BFILE);</div>
<div class="line"></div>
<div class="line">    <span class="comment">/* create objects and set values */</span></div>
<div class="line"></div>
<div class="line">    <span class="keywordflow">for</span>(i = 0; i &lt; SIZE_TAB; i++)</div>
<div class="line">    {</div>
<div class="line">        <span class="comment">/* scalar types */</span></div>
<div class="line">        tab_int[i] = i+1;</div>
<div class="line">        tab_dbl[i] = 3.14*(double)(i+1);</div>
<div class="line">        tab_flt[i] = (float) 3.14*(<span class="keywordtype">float</span>)(i+1);</div>
<div class="line">        osprintf(tab_str[i], 30, OTEXT(<span class="stringliteral">&quot;Name%02i&quot;</span>), i+1);</div>
<div class="line"></div>
<div class="line">        <span class="comment">/* date */</span></div>
<div class="line">        <a class="code" href="group___ocilib_c_api_datetimes.html#gad7c5c65d88b52e6ecb46b3e9ba8843dc">OCI_DateSysDate</a>(tab_date[i]);</div>
<div class="line"></div>
<div class="line">        <span class="comment">/* lob */</span></div>
<div class="line">        osprintf(temp, SIZE_STR, OTEXT(<span class="stringliteral">&quot;lob value%02i&quot;</span>), i+1);</div>
<div class="line">        <a class="code" href="group___ocilib_c_api_lobs.html#ga949f7050609430486c9ef0f3c488d38a">OCI_LobWrite</a>(tab_lob[i], temp, (<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span>) ostrlen(temp));</div>
<div class="line"></div>
<div class="line">        <span class="comment">/* file */</span></div>
<div class="line">        osprintf(str, SIZE_STR, OTEXT(<span class="stringliteral">&quot;file%02i.txt&quot;</span>), i+1);</div>
<div class="line">        <a class="code" href="group___ocilib_c_api_files.html#ga17e77f8545ef10e2a081b19ae915a6ae">OCI_FileSetName</a>(tab_file[i], OTEXT(<span class="stringliteral">&quot;mydir&quot;</span>), str);</div>
<div class="line">    }</div>
<div class="line"></div>
<div class="line">    <a class="code" href="group___ocilib_c_api_statements.html#ga7189aa353845909aaedc8d5956429450">OCI_Execute</a>(st);</div>
<div class="line"></div>
<div class="line">    print_frmt(<span class="stringliteral">&quot;Row inserted : %u\n\n&quot;</span>, <a class="code" href="group___ocilib_c_api_statements.html#ga1cf932261960da80cd36d650a08565c3">OCI_GetAffectedRows</a>(st));</div>
<div class="line"></div>
<div class="line">    <span class="comment">/* free objects */</span></div>
<div class="line"></div>
<div class="line">    <a class="code" href="group___ocilib_c_api_datetimes.html#gaa816548e8ae506c965d46811f7ffecf5">OCI_DateArrayFree</a>(tab_date);</div>
<div class="line">    <a class="code" href="group___ocilib_c_api_lobs.html#ga4e317df72cb3e3014c9161c892e68186">OCI_LobArrayFree</a>(tab_lob);</div>
<div class="line">    <a class="code" href="group___ocilib_c_api_files.html#ga081c016b3b514bd47f3f9cb8656215ea">OCI_FileArrayFree</a>(tab_file);</div>
<div class="line"></div>
<div class="line">    <span class="comment">/* Get back data  from the returning clause</span></div>
<div class="line"><span class="comment">       Obviously, each entry of the array will return a resultset containing</span></div>
<div class="line"><span class="comment">       1 row only (DML insert)</span></div>
<div class="line"><span class="comment">    */</span></div>
<div class="line"></div>
<div class="line">    rs = <a class="code" href="group___ocilib_c_api_fetching.html#gaf2a9e28b66a9538ba0ffb62bffb87c16">OCI_GetResultset</a>(st);</div>
<div class="line"></div>
<div class="line">    i = 1;</div>
<div class="line"></div>
<div class="line">    <span class="keywordflow">while</span> (rs != NULL)</div>
<div class="line">    {</div>
<div class="line">        <span class="keywordflow">while</span> (<a class="code" href="group___ocilib_c_api_fetching.html#ga36ac26dcea78f6074421781e401f97ba">OCI_FetchNext</a>(rs))</div>
<div class="line">        {</div>
<div class="line">            print_frmt(<span class="stringliteral">&quot;Row # %d-------------------\n&quot;</span>, i);</div>
<div class="line"></div>
<div class="line">            print_frmt(<span class="stringliteral">&quot;.... val_int    : %i\n&quot;</span>, <a class="code" href="group___ocilib_c_api_fetching.html#gac4c468b115909db951f2e23a5e6d07cf">OCI_GetInt2</a>(rs, OTEXT(<span class="stringliteral">&quot;:OUT_INT&quot;</span>)));</div>
<div class="line">            print_frmt(<span class="stringliteral">&quot;.... val_dbl    : %g\n&quot;</span>, <a class="code" href="group___ocilib_c_api_fetching.html#ga90298f0fe263719bdc986f6f04766157">OCI_GetDouble2</a>(rs, OTEXT(<span class="stringliteral">&quot;:OUT_DBL&quot;</span>)));</div>
<div class="line">            print_frmt(<span class="stringliteral">&quot;.... val_flt    : %g\n&quot;</span>, <a class="code" href="group___ocilib_c_api_fetching.html#gafb366c639fd239631a279240016bb83e">OCI_GetFloat2</a>(rs, OTEXT(<span class="stringliteral">&quot;:OUT_FLT&quot;</span>)));</div>
<div class="line">            print_text(<span class="stringliteral">&quot;.... val_str    : &quot;</span>); print_ostr(<a class="code" href="group___ocilib_c_api_fetching.html#gaae77e6ff755a8c85e3c646f07fa4f76c">OCI_GetString2</a>(rs, OTEXT(<span class="stringliteral">&quot;:OUT_STR&quot;</span>)));</div>
<div class="line">            print_text(<span class="stringliteral">&quot;\n&quot;</span>);</div>
<div class="line"></div>
<div class="line">            date = <a class="code" href="group___ocilib_c_api_fetching.html#ga4c9dd52dfb546a33b011c40e0eb28115">OCI_GetDate2</a>(rs, OTEXT(<span class="stringliteral">&quot;:OUT_DATE&quot;</span>));</div>
<div class="line">            <a class="code" href="group___ocilib_c_api_datetimes.html#gaca5b7b09eae70235fa9c068a7a6df971">OCI_DateToText</a>(date, OTEXT(<span class="stringliteral">&quot;YYYY-MM-DD HH24:MI:SS&quot;</span>), SIZE_STR, str);</div>
<div class="line">            print_text(<span class="stringliteral">&quot;.... val_date   : &quot;</span>); print_ostr(str);</div>
<div class="line">            print_text(<span class="stringliteral">&quot;\n&quot;</span>);</div>
<div class="line"></div>
<div class="line">            lob  = <a class="code" href="group___ocilib_c_api_fetching.html#ga437fd8f2ab9b0ec7d4accf25b75d3512">OCI_GetLob2</a>(rs, OTEXT(<span class="stringliteral">&quot;:OUT_LOB&quot;</span>));</div>
<div class="line">            temp[<a class="code" href="group___ocilib_c_api_lobs.html#ga36708313dc7d5c0b2c30f7f8b9fa2e2d">OCI_LobRead</a>(lob, temp, 100)]=0;</div>
<div class="line">            print_text(<span class="stringliteral">&quot;.... val_lob    : &quot;</span>); print_ostr(temp);</div>
<div class="line">            print_text(<span class="stringliteral">&quot;\n&quot;</span>);</div>
<div class="line"></div>
<div class="line">            file = <a class="code" href="group___ocilib_c_api_fetching.html#ga2a7ec7c2c056dd145ab32bc41fabcd2d">OCI_GetFile2</a>(rs, OTEXT(<span class="stringliteral">&quot;:OUT_FILE&quot;</span>));</div>
<div class="line">            print_text(<span class="stringliteral">&quot;.... val_file   : &quot;</span>);</div>
<div class="line">            print_ostr(<a class="code" href="group___ocilib_c_api_files.html#gae3e7de24ad2974ebdce48524f26f7d6b">OCI_FileGetDirectory</a>(file));</div>
<div class="line">            print_text(<span class="stringliteral">&quot;/&quot;</span>);</div>
<div class="line">            print_ostr(<a class="code" href="group___ocilib_c_api_files.html#ga998ff160e890c6898f218c9841c062fc">OCI_FileGetName</a>(file));</div>
<div class="line">            print_text(<span class="stringliteral">&quot;\n&quot;</span>);</div>
<div class="line"></div>
<div class="line">            print_text(<span class="stringliteral">&quot;\n&quot;</span>);</div>
<div class="line">            i++;</div>
<div class="line">        }</div>
<div class="line"></div>
<div class="line">        rs = <a class="code" href="group___ocilib_c_api_feature_returning_into.html#ga67cbb956e8d721c8397e3f897a57b224">OCI_GetNextResultset</a>(st);</div>
<div class="line">    }</div>
<div class="line">}</div>
<div class="line"></div>
<div class="line"><span class="comment">/* --------------------------------------------------------------------------------------------- *</span></div>
<div class="line"><span class="comment"> * test_object_insert</span></div>
<div class="line"><span class="comment"> * --------------------------------------------------------------------------------------------- */</span></div>
<div class="line"></div>
<div class="line"><span class="keywordtype">void</span> test_object_insert(<span class="keywordtype">void</span>)</div>
<div class="line">{</div>
<div class="line">    <a class="code" href="group___ocilib_c_api_datatypes.html#ga549efec5df4c0825db908a5ceb9ab614">OCI_Date</a> *date;</div>
<div class="line">    <a class="code" href="group___ocilib_c_api_datatypes.html#gad57163fd9169661f31821898c0a86b1d">OCI_File</a> *file;</div>
<div class="line">    <a class="code" href="group___ocilib_c_api_datatypes.html#ga8b274b67a4c2320612d4dfb3083131f5">OCI_Lob</a>  *lob;</div>
<div class="line">    <a class="code" href="group___ocilib_c_api_datatypes.html#ga270329793bf4735351b6007bc20d41ae">OCI_Object</a> *obj;</div>
<div class="line">    <a class="code" href="group___ocilib_c_api_datatypes.html#ga270329793bf4735351b6007bc20d41ae">OCI_Object</a> *obj2;</div>
<div class="line"></div>
<div class="line">    <span class="keywordtype">char</span> rawbuf[11];</div>
<div class="line"></div>
<div class="line">    strcpy(rawbuf, <span class="stringliteral">&quot;0123456789&quot;</span>);</div>
<div class="line"></div>
<div class="line">    print_text(<span class="stringliteral">&quot;\n&gt;&gt;&gt;&gt;&gt; TEST OBJECT BINDING \n\n&quot;</span>);</div>
<div class="line"></div>
<div class="line">    <span class="comment">/* create types for the demo */</span></div>
<div class="line"></div>
<div class="line">    obj  = <a class="code" href="group___ocilib_c_api_user_types.html#ga5e8f1db675e2b4fe74c82bdc79be8294">OCI_ObjectCreate</a>(cn, <a class="code" href="group___ocilib_c_api_metadata.html#ga541bb34a0a86c6296f59605f85931039">OCI_TypeInfoGet</a>(cn, OTEXT(<span class="stringliteral">&quot;test_t&quot;</span>), OCI_TIF_TYPE));</div>
<div class="line"></div>
<div class="line">    <a class="code" href="group___ocilib_c_api_user_types.html#ga0840426bd6dbdb6f667557e13faa9eee">OCI_ObjectSetInt</a>(obj, OTEXT(<span class="stringliteral">&quot;VAL_INT&quot;</span>), 1);</div>
<div class="line">    <a class="code" href="group___ocilib_c_api_user_types.html#ga92086c5b09f25cd575d36437b9fe641c">OCI_ObjectSetDouble</a>(obj, OTEXT(<span class="stringliteral">&quot;VAL_DBL&quot;</span>), 3.14);</div>
<div class="line">    <a class="code" href="group___ocilib_c_api_user_types.html#ga2ee813b87f8879567916bbae86487b9d">OCI_ObjectSetFloat</a>(obj, OTEXT(<span class="stringliteral">&quot;VAL_FLT&quot;</span>), (<span class="keywordtype">float</span>) 3.14);</div>
<div class="line">    <a class="code" href="group___ocilib_c_api_user_types.html#ga8cdf9688b89dc5e93ea10a2421ace3eb">OCI_ObjectSetString</a>(obj, OTEXT(<span class="stringliteral">&quot;VAL_STR&quot;</span>), OTEXT(<span class="stringliteral">&quot;USB KEY 2go&quot;</span>));</div>
<div class="line">    <a class="code" href="group___ocilib_c_api_user_types.html#ga753382248808b13381ff45d0169554b8">OCI_ObjectSetRaw</a>(obj, OTEXT(<span class="stringliteral">&quot;VAL_RAW&quot;</span>), rawbuf, 10);</div>
<div class="line"></div>
<div class="line">    date = <a class="code" href="group___ocilib_c_api_datetimes.html#gae80eacef54641a68c3b82be85f4a5042">OCI_DateCreate</a>(cn);</div>
<div class="line">    <a class="code" href="group___ocilib_c_api_datetimes.html#gad7c5c65d88b52e6ecb46b3e9ba8843dc">OCI_DateSysDate</a>(date);</div>
<div class="line">    <a class="code" href="group___ocilib_c_api_user_types.html#ga465c4b514c0881561be62d26a38ce751">OCI_ObjectSetDate</a>(obj, OTEXT(<span class="stringliteral">&quot;VAL_DATE&quot;</span>), date);</div>
<div class="line"></div>
<div class="line">    obj2 = <a class="code" href="group___ocilib_c_api_user_types.html#ga5e8f1db675e2b4fe74c82bdc79be8294">OCI_ObjectCreate</a>(cn, <a class="code" href="group___ocilib_c_api_metadata.html#ga541bb34a0a86c6296f59605f85931039">OCI_TypeInfoGet</a>(cn, OTEXT(<span class="stringliteral">&quot;TYPE_T&quot;</span>), OCI_TIF_TYPE));</div>
<div class="line">    <a class="code" href="group___ocilib_c_api_user_types.html#ga0840426bd6dbdb6f667557e13faa9eee">OCI_ObjectSetInt</a>(obj2, OTEXT(<span class="stringliteral">&quot;ID&quot;</span>), 1);</div>
<div class="line"></div>
<div class="line">    <a class="code" href="group___ocilib_c_api_user_types.html#ga8cdf9688b89dc5e93ea10a2421ace3eb">OCI_ObjectSetString</a>(obj2, OTEXT(<span class="stringliteral">&quot;NAME&quot;</span>), OTEXT(<span class="stringliteral">&quot;USB KEY 2go&quot;</span>));</div>
<div class="line">    <a class="code" href="group___ocilib_c_api_user_types.html#ga722556b52d2c3e5eabdea2246ceba4a2">OCI_ObjectSetObject</a>(obj, OTEXT(<span class="stringliteral">&quot;VAL_OBJ&quot;</span>), obj2);</div>
<div class="line"></div>
<div class="line">    lob = <a class="code" href="group___ocilib_c_api_lobs.html#ga318f1273603e24b51c3d9e4c29f42685">OCI_LobCreate</a>(cn, OCI_CLOB);</div>
<div class="line">    <a class="code" href="group___ocilib_c_api_user_types.html#ga92742248dfbec82c92978602ba4a4c70">OCI_ObjectSetLob</a>(obj, OTEXT(<span class="stringliteral">&quot;VAL_LOB&quot;</span>), lob);</div>
<div class="line"></div>
<div class="line">    file = <a class="code" href="group___ocilib_c_api_files.html#ga199d6ce1a1231feb56b456ad6cbc2714">OCI_FileCreate</a>(cn, OCI_BFILE);</div>
<div class="line">    <a class="code" href="group___ocilib_c_api_files.html#ga17e77f8545ef10e2a081b19ae915a6ae">OCI_FileSetName</a>(file, OTEXT(<span class="stringliteral">&quot;mydir&quot;</span>), OTEXT(<span class="stringliteral">&quot;myfile&quot;</span>));</div>
<div class="line">    <a class="code" href="group___ocilib_c_api_user_types.html#ga8d509b3e357479e1d3a107a1990266ed">OCI_ObjectSetFile</a>(obj, OTEXT(<span class="stringliteral">&quot;VAL_FILE&quot;</span>), file);</div>
<div class="line"></div>
<div class="line">    <a class="code" href="group___ocilib_c_api_statements.html#ga592e4b3cf3df7e152c46fab5d6e3b3af">OCI_Prepare</a>(st, OTEXT(<span class="stringliteral">&quot;insert into test_object values(:obj)&quot;</span>));</div>
<div class="line">    <a class="code" href="group___ocilib_c_api_binding.html#gae1ec5caba8bd4dc2a267243be88d0864">OCI_BindObject</a>(st, OTEXT(<span class="stringliteral">&quot;:obj&quot;</span>), obj);</div>
<div class="line">    <a class="code" href="group___ocilib_c_api_statements.html#ga7189aa353845909aaedc8d5956429450">OCI_Execute</a>(st);</div>
<div class="line"></div>
<div class="line">    print_frmt(<span class="stringliteral">&quot;\n%u row(s) inserted\n&quot;</span>, <a class="code" href="group___ocilib_c_api_statements.html#ga1cf932261960da80cd36d650a08565c3">OCI_GetAffectedRows</a>(st));</div>
<div class="line"></div>
<div class="line">    <a class="code" href="group___ocilib_c_api_transactions.html#gaee1ba614ed2dc5bd83bf788ca08f3e71">OCI_Commit</a>(cn);</div>
<div class="line"></div>
<div class="line">    <a class="code" href="group___ocilib_c_api_datetimes.html#gaedf77cfe4bd5dab7909e4c2fb5173b48">OCI_DateFree</a>(date);</div>
<div class="line">    <a class="code" href="group___ocilib_c_api_lobs.html#gaac269a3de312c2c7d1a6193a9ab79545">OCI_LobFree</a>(lob);</div>
<div class="line">    <a class="code" href="group___ocilib_c_api_files.html#gad4b58b6d80e24bb045fb82d78c5cf36a">OCI_FileFree</a>(file);</div>
<div class="line">    <a class="code" href="group___ocilib_c_api_user_types.html#ga3fd2c9dfdcab2c56400c95c31cc0851e">OCI_ObjectFree</a>(obj2);</div>
<div class="line">    <a class="code" href="group___ocilib_c_api_user_types.html#ga3fd2c9dfdcab2c56400c95c31cc0851e">OCI_ObjectFree</a>(obj);</div>
<div class="line">}</div>
<div class="line"></div>
<div class="line"><span class="comment">/* --------------------------------------------------------------------------------------------- *</span></div>
<div class="line"><span class="comment"> * test_object_fetch</span></div>
<div class="line"><span class="comment"> * --------------------------------------------------------------------------------------------- */</span></div>
<div class="line"></div>
<div class="line"><span class="keywordtype">void</span> test_object_fetch(<span class="keywordtype">void</span>)</div>
<div class="line">{</div>
<div class="line">    <a class="code" href="group___ocilib_c_api_datatypes.html#ga8b274b67a4c2320612d4dfb3083131f5">OCI_Lob</a> *lob;</div>
<div class="line">    <a class="code" href="group___ocilib_c_api_datatypes.html#ga549efec5df4c0825db908a5ceb9ab614">OCI_Date</a> *date;</div>
<div class="line">    <a class="code" href="group___ocilib_c_api_datatypes.html#gad57163fd9169661f31821898c0a86b1d">OCI_File</a> *file;</div>
<div class="line">    <a class="code" href="group___ocilib_c_api_datatypes.html#ga270329793bf4735351b6007bc20d41ae">OCI_Object</a> *obj;</div>
<div class="line">    <a class="code" href="group___ocilib_c_api_datatypes.html#ga270329793bf4735351b6007bc20d41ae">OCI_Object</a> *obj2;</div>
<div class="line">    <span class="keywordtype">char</span> rawbuf[11] = <span class="stringliteral">&quot;&quot;</span>;</div>
<div class="line"></div>
<div class="line">    print_text(<span class="stringliteral">&quot;\n&gt;&gt;&gt;&gt;&gt; TEST OBJECT FETCHING \n\n&quot;</span>);</div>
<div class="line"></div>
<div class="line">    <a class="code" href="group___ocilib_c_api_statements.html#ga8b2b66994f847d9f0b6b0efe4a13ccf3">OCI_ExecuteStmt</a>(st, OTEXT(<span class="stringliteral">&quot;select val from test_object for update&quot;</span>));</div>
<div class="line"></div>
<div class="line">    rs = <a class="code" href="group___ocilib_c_api_fetching.html#gaf2a9e28b66a9538ba0ffb62bffb87c16">OCI_GetResultset</a>(st);</div>
<div class="line"></div>
<div class="line">    <span class="comment">/* print resultset content */</span></div>
<div class="line">    <span class="keywordflow">while</span> (<a class="code" href="group___ocilib_c_api_fetching.html#ga36ac26dcea78f6074421781e401f97ba">OCI_FetchNext</a>(rs))</div>
<div class="line">    {</div>
<div class="line">        obj  = <a class="code" href="group___ocilib_c_api_fetching.html#gabef5c4bbab7c79ce2fa9113d1a23a865">OCI_GetObject</a>(rs, 1);</div>
<div class="line"></div>
<div class="line">        print_frmt(<span class="stringliteral">&quot;val_int        : %i\n&quot;</span>,  <a class="code" href="group___ocilib_c_api_user_types.html#gae08835d39b227d5af9348be9ba20829d">OCI_ObjectGetInt</a>(obj, OTEXT(<span class="stringliteral">&quot;VAL_INT&quot;</span>)));</div>
<div class="line">        print_frmt(<span class="stringliteral">&quot;val_dbl        : %g\n&quot;</span>,  <a class="code" href="group___ocilib_c_api_user_types.html#ga18173b7edcb189ac084d4a292061e380">OCI_ObjectGetFloat</a>(obj, OTEXT(<span class="stringliteral">&quot;VAL_DBL&quot;</span>)));</div>
<div class="line">        print_frmt(<span class="stringliteral">&quot;val_flt        : %g\n&quot;</span>,  <a class="code" href="group___ocilib_c_api_user_types.html#ga7c237f6c24097373c9f8f08eaef6d210">OCI_ObjectGetDouble</a>(obj, OTEXT(<span class="stringliteral">&quot;VAL_FLT&quot;</span>)));</div>
<div class="line">        print_text(<span class="stringliteral">&quot;val_str        : &quot;</span>); print_ostr(<a class="code" href="group___ocilib_c_api_user_types.html#gad495abec0bf414a31a6689e6de33335c">OCI_ObjectGetString</a>(obj, OTEXT(<span class="stringliteral">&quot;VAL_STR&quot;</span>)));</div>
<div class="line">        print_text(<span class="stringliteral">&quot;\n&quot;</span>);</div>
<div class="line"></div>
<div class="line">        temp[<a class="code" href="group___ocilib_c_api_user_types.html#gae3744a717507d6fee279715a71b24a70">OCI_ObjectGetRaw</a>(obj, OTEXT(<span class="stringliteral">&quot;VAL_RAW&quot;</span>), rawbuf, 10)] = 0;</div>
<div class="line">        print_text(<span class="stringliteral">&quot;val_raw        : &quot;</span>); print_text(rawbuf);</div>
<div class="line">        print_text(<span class="stringliteral">&quot;\n&quot;</span>);</div>
<div class="line"></div>
<div class="line">        date = <a class="code" href="group___ocilib_c_api_user_types.html#ga1b99b1e3b540788f8d7d34df866f31c1">OCI_ObjectGetDate</a>(obj, OTEXT(<span class="stringliteral">&quot;VAL_DATE&quot;</span>));</div>
<div class="line">        <a class="code" href="group___ocilib_c_api_datetimes.html#gaca5b7b09eae70235fa9c068a7a6df971">OCI_DateToText</a>(date, OTEXT(<span class="stringliteral">&quot;YYYY-MM-DD HH24:MI:SS&quot;</span>), SIZE_STR, str);</div>
<div class="line">        print_text(<span class="stringliteral">&quot;val_date       : &quot;</span>); print_ostr(str);</div>
<div class="line">        print_text(<span class="stringliteral">&quot;\n&quot;</span>);</div>
<div class="line"></div>
<div class="line">        lob = <a class="code" href="group___ocilib_c_api_user_types.html#gaa54219d495ad104d806c66d90bb7fc88">OCI_ObjectGetLob</a>(obj, OTEXT(<span class="stringliteral">&quot;VAL_LOB&quot;</span>));</div>
<div class="line"></div>
<div class="line">        <a class="code" href="group___ocilib_c_api_lobs.html#ga949f7050609430486c9ef0f3c488d38a">OCI_LobWrite</a>(lob, OTEXT(<span class="stringliteral">&quot;Hello from Mars !&quot;</span>), 17);</div>
<div class="line">        <a class="code" href="group___ocilib_c_api_lobs.html#ga63df7f944c418642fc04571a4a522b87">OCI_LobSeek</a>(lob, 0, OCI_SEEK_SET);</div>
<div class="line"></div>
<div class="line">        temp[<a class="code" href="group___ocilib_c_api_lobs.html#ga36708313dc7d5c0b2c30f7f8b9fa2e2d">OCI_LobRead</a>(lob, temp, SIZE_STR)]=0;</div>
<div class="line"></div>
<div class="line">        print_text(<span class="stringliteral">&quot;val_lob        : &quot;</span>); print_ostr(temp);</div>
<div class="line">        print_text(<span class="stringliteral">&quot;\n&quot;</span>);</div>
<div class="line"></div>
<div class="line">        file = <a class="code" href="group___ocilib_c_api_user_types.html#gab1c4556a72ea9e9d488a6ed32703665c">OCI_ObjectGetFile</a>(obj, OTEXT(<span class="stringliteral">&quot;VAL_FILE&quot;</span>));</div>
<div class="line">        print_text(<span class="stringliteral">&quot;val_file.dir   : &quot;</span>); print_ostr(<a class="code" href="group___ocilib_c_api_files.html#gae3e7de24ad2974ebdce48524f26f7d6b">OCI_FileGetDirectory</a>(file));</div>
<div class="line">        print_text(<span class="stringliteral">&quot;\n&quot;</span>);</div>
<div class="line">        print_text(<span class="stringliteral">&quot;val_file.name  : &quot;</span>); print_ostr(<a class="code" href="group___ocilib_c_api_files.html#ga998ff160e890c6898f218c9841c062fc">OCI_FileGetName</a>(file));</div>
<div class="line">        print_text(<span class="stringliteral">&quot;\n&quot;</span>);</div>
<div class="line"></div>
<div class="line">        obj2 = <a class="code" href="group___ocilib_c_api_user_types.html#ga008d5309fc04082d15e63baeb6a93d1d">OCI_ObjectGetObject</a>(obj, OTEXT(<span class="stringliteral">&quot;VAL_OBJ&quot;</span>));</div>
<div class="line">        print_frmt(<span class="stringliteral">&quot;val_obj.code   : %i\n&quot;</span>, <a class="code" href="group___ocilib_c_api_user_types.html#gae08835d39b227d5af9348be9ba20829d">OCI_ObjectGetInt</a>(obj2, OTEXT(<span class="stringliteral">&quot;ID&quot;</span>)));</div>
<div class="line">        print_text(<span class="stringliteral">&quot;val_obj.name   : &quot;</span>); print_ostr(<a class="code" href="group___ocilib_c_api_user_types.html#gad495abec0bf414a31a6689e6de33335c">OCI_ObjectGetString</a>(obj2, OTEXT(<span class="stringliteral">&quot;NAME&quot;</span>)));</div>
<div class="line">        print_text(<span class="stringliteral">&quot;\n&quot;</span>);</div>
<div class="line"></div>
<div class="line">        print_text(<span class="stringliteral">&quot;\n&quot;</span>);;</div>
<div class="line"></div>
<div class="line">    }</div>
<div class="line"></div>
<div class="line">    <a class="code" href="group___ocilib_c_api_transactions.html#gaee1ba614ed2dc5bd83bf788ca08f3e71">OCI_Commit</a>(cn);</div>
<div class="line">}</div>
<div class="line"></div>
<div class="line"></div>
<div class="line"><span class="comment">/* --------------------------------------------------------------------------------------------- *</span></div>
<div class="line"><span class="comment"> * test_object_string</span></div>
<div class="line"><span class="comment"> * --------------------------------------------------------------------------------------------- */</span></div>
<div class="line"></div>
<div class="line"><span class="keywordtype">void</span> test_object_fetch_string(<span class="keywordtype">void</span>)</div>
<div class="line">{</div>
<div class="line">    print_text(<span class="stringliteral">&quot;\n&gt;&gt;&gt;&gt;&gt; TEST OBJECT FETCHING AS STRING \n\n&quot;</span>);</div>
<div class="line"></div>
<div class="line">    <a class="code" href="group___ocilib_c_api_statements.html#ga8b2b66994f847d9f0b6b0efe4a13ccf3">OCI_ExecuteStmt</a>(st, OTEXT(<span class="stringliteral">&quot;select val from test_object&quot;</span>));</div>
<div class="line"></div>
<div class="line">    rs = <a class="code" href="group___ocilib_c_api_fetching.html#gaf2a9e28b66a9538ba0ffb62bffb87c16">OCI_GetResultset</a>(st);</div>
<div class="line"></div>
<div class="line">    <span class="comment">/* print resultset content */</span></div>
<div class="line">    <span class="keywordflow">while</span> (<a class="code" href="group___ocilib_c_api_fetching.html#ga36ac26dcea78f6074421781e401f97ba">OCI_FetchNext</a>(rs))</div>
<div class="line">    {</div>
<div class="line">        print_ostr(<a class="code" href="group___ocilib_c_api_fetching.html#ga2a3252984f674fab5358c94d58c689b2">OCI_GetString</a>(rs, 1));</div>
<div class="line">        print_text(<span class="stringliteral">&quot;\n&quot;</span>);</div>
<div class="line">    }</div>
<div class="line">}</div>
<div class="line"></div>
<div class="line"><span class="comment">/* --------------------------------------------------------------------------------------------- *</span></div>
<div class="line"><span class="comment"> * test_scrollable_cursor</span></div>
<div class="line"><span class="comment"> * --------------------------------------------------------------------------------------------- */</span></div>
<div class="line"></div>
<div class="line"><span class="keywordtype">void</span> test_scrollable_cursor(<span class="keywordtype">void</span>)</div>
<div class="line">{</div>
<div class="line">    <span class="keywordflow">if</span> (<a class="code" href="group___ocilib_c_api_connections.html#ga6f61147801fce4b69edb4981ba4ea1b7">OCI_GetVersionConnection</a>(cn) &gt;= OCI_9_0)</div>
<div class="line">    {</div>
<div class="line">        print_text(<span class="stringliteral">&quot;\n&gt;&gt;&gt;&gt;&gt; TEST SCROLLABLE CURSORS \n\n&quot;</span>);</div>
<div class="line"></div>
<div class="line">        <a class="code" href="group___ocilib_c_api_statement_control.html#ga83e1c31e40926a84651eb60fefd50d5e">OCI_SetFetchMode</a>(st, OCI_SFM_SCROLLABLE);</div>
<div class="line"></div>
<div class="line">        <a class="code" href="group___ocilib_c_api_statements.html#ga8b2b66994f847d9f0b6b0efe4a13ccf3">OCI_ExecuteStmt</a>(st, OTEXT(<span class="stringliteral">&quot;select table_name from user_tables where &quot;</span>)</div>
<div class="line">                            OTEXT(<span class="stringliteral">&quot;table_name like &#39;TEST_%&#39; order by table_name&quot;</span>));</div>
<div class="line"></div>
<div class="line">        rs = <a class="code" href="group___ocilib_c_api_fetching.html#gaf2a9e28b66a9538ba0ffb62bffb87c16">OCI_GetResultset</a>(st);</div>
<div class="line"></div>
<div class="line">        <span class="keywordflow">if</span> (<a class="code" href="group___ocilib_c_api_fetching.html#gab2b3f30ace2a89b07dd7803c82a523e7">OCI_FetchLast</a>(rs))</div>
<div class="line">            print_frmt(<span class="stringliteral">&quot;... Resultset contains %u rows\n\n&quot;</span>, <a class="code" href="group___ocilib_c_api_fetching.html#ga93bd9197720088dbda2bef593ad1c07c">OCI_GetRowCount</a>(rs));</div>
<div class="line"></div>
<div class="line">        print_text(<span class="stringliteral">&quot;... Go to row 1\n&quot;</span>);</div>
<div class="line">        <span class="keywordflow">if</span> (<a class="code" href="group___ocilib_c_api_fetching.html#gaf26bde3f9db77231d66107af24a51d96">OCI_FetchFirst</a>(rs))</div>
<div class="line">        {</div>
<div class="line">            print_ostr(<a class="code" href="group___ocilib_c_api_fetching.html#ga2a3252984f674fab5358c94d58c689b2">OCI_GetString</a>(rs, 1));</div>
<div class="line">            print_text(<span class="stringliteral">&quot;\n&quot;</span>);</div>
<div class="line">        }</div>
<div class="line"></div>
<div class="line">        print_frmt(<span class="stringliteral">&quot;... Enumerate from row 2 to row %u\n&quot;</span>, <a class="code" href="group___ocilib_c_api_fetching.html#ga93bd9197720088dbda2bef593ad1c07c">OCI_GetRowCount</a>(rs));</div>
<div class="line">        <span class="keywordflow">while</span> (<a class="code" href="group___ocilib_c_api_fetching.html#ga36ac26dcea78f6074421781e401f97ba">OCI_FetchNext</a>(rs))</div>
<div class="line">        {</div>
<div class="line">            print_ostr(<a class="code" href="group___ocilib_c_api_fetching.html#ga2a3252984f674fab5358c94d58c689b2">OCI_GetString</a>(rs, 1));</div>
<div class="line">            print_text(<span class="stringliteral">&quot;\n&quot;</span>);</div>
<div class="line">        }</div>
<div class="line"></div>
<div class="line">        print_frmt(<span class="stringliteral">&quot;... Enumerate from row %u back to row 1\n&quot;</span>, <a class="code" href="group___ocilib_c_api_fetching.html#ga93bd9197720088dbda2bef593ad1c07c">OCI_GetRowCount</a>(rs)-1);</div>
<div class="line">        <span class="keywordflow">while</span> (<a class="code" href="group___ocilib_c_api_fetching.html#ga81e501b509b84d999e4337e2e11a90ec">OCI_FetchPrev</a>(rs))</div>
<div class="line">        {</div>
<div class="line">            print_ostr(<a class="code" href="group___ocilib_c_api_fetching.html#ga2a3252984f674fab5358c94d58c689b2">OCI_GetString</a>(rs, 1));</div>
<div class="line">            print_text(<span class="stringliteral">&quot;\n&quot;</span>);</div>
<div class="line">        }</div>
<div class="line"></div>
<div class="line">        print_text(<span class="stringliteral">&quot;... Go to the 3th row\n&quot;</span>);</div>
<div class="line">        <span class="keywordflow">if</span> (<a class="code" href="group___ocilib_c_api_fetching.html#ga99372dc21a4965ca74d8fdde2069cc10">OCI_FetchSeek</a>(rs, OCI_SFD_ABSOLUTE,  3))</div>
<div class="line">        {</div>
<div class="line">            print_ostr(<a class="code" href="group___ocilib_c_api_fetching.html#ga2a3252984f674fab5358c94d58c689b2">OCI_GetString</a>(rs, 1));</div>
<div class="line">            print_text(<span class="stringliteral">&quot;\n&quot;</span>);</div>
<div class="line">        }</div>
<div class="line"></div>
<div class="line">        print_text(<span class="stringliteral">&quot;... Fetch the next 2 rows\n&quot;</span>);</div>
<div class="line">        <span class="keywordflow">while</span> ((<a class="code" href="group___ocilib_c_api_fetching.html#ga4add0a9c53a23b334197c655b46b620c">OCI_GetCurrentRow</a>(rs) &lt; 5) &amp;&amp; <a class="code" href="group___ocilib_c_api_fetching.html#ga36ac26dcea78f6074421781e401f97ba">OCI_FetchNext</a>(rs))</div>
<div class="line">        {</div>
<div class="line">            print_ostr(<a class="code" href="group___ocilib_c_api_fetching.html#ga2a3252984f674fab5358c94d58c689b2">OCI_GetString</a>(rs, 1));</div>
<div class="line">            print_text(<span class="stringliteral">&quot;\n&quot;</span>);</div>
<div class="line">        }</div>
<div class="line"></div>
<div class="line">        <a class="code" href="group___ocilib_c_api_statement_control.html#ga83e1c31e40926a84651eb60fefd50d5e">OCI_SetFetchMode</a>(st, OCI_SFM_DEFAULT);</div>
<div class="line">    }</div>
<div class="line">}</div>
<div class="line"></div>
<div class="line"><span class="comment">/* --------------------------------------------------------------------------------------------- *</span></div>
<div class="line"><span class="comment"> * test_collection</span></div>
<div class="line"><span class="comment"> * --------------------------------------------------------------------------------------------- */</span></div>
<div class="line"></div>
<div class="line"><span class="keywordtype">void</span> test_collection(<span class="keywordtype">void</span>)</div>
<div class="line">{</div>
<div class="line">    <a class="code" href="group___ocilib_c_api_datatypes.html#gad33099e82262f1f484c19283d5f812c6">OCI_TypeInfo</a> *type;</div>
<div class="line">    <a class="code" href="group___ocilib_c_api_datatypes.html#ga5891a18e9f8ad138e4ec365b834a04d9">OCI_Coll</a>     *coll;</div>
<div class="line">    <a class="code" href="group___ocilib_c_api_datatypes.html#gaf88481fd4329ba97717805effd4b8fc9">OCI_Iter</a>     *iter;</div>
<div class="line">    <a class="code" href="group___ocilib_c_api_datatypes.html#ga1210aec5a07ce9ed82199b3359d371bf">OCI_Elem</a>     *elem;</div>
<div class="line">    <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> i, n;</div>
<div class="line"></div>
<div class="line">    print_text(<span class="stringliteral">&quot;\n&gt;&gt;&gt;&gt;&gt; TEST VARRAY BINDING \n\n&quot;</span>);</div>
<div class="line"></div>
<div class="line">    type = <a class="code" href="group___ocilib_c_api_metadata.html#ga541bb34a0a86c6296f59605f85931039">OCI_TypeInfoGet</a>(cn, OTEXT(<span class="stringliteral">&quot;T_TAB1_EMP&quot;</span>), OCI_TIF_TYPE);</div>
<div class="line">    coll = <a class="code" href="group___ocilib_c_api_collections.html#gaa2c5c18fa416fe1f955ccb5dbff43046">OCI_CollCreate</a>(type);</div>
<div class="line"></div>
<div class="line">    <a class="code" href="group___ocilib_c_api_statements.html#ga592e4b3cf3df7e152c46fab5d6e3b3af">OCI_Prepare</a>(st, OTEXT(<span class="stringliteral">&quot;begin&quot;</span>)</div>
<div class="line">                    OTEXT(<span class="stringliteral">&quot;    select employees into :tab_emp &quot;</span>)</div>
<div class="line">                    OTEXT(<span class="stringliteral">&quot;    from test_coll_varray &quot;</span>)</div>
<div class="line">                    OTEXT(<span class="stringliteral">&quot;    where departement = :id; &quot;</span>)</div>
<div class="line">                    OTEXT(<span class="stringliteral">&quot;end;&quot;</span>));</div>
<div class="line"></div>
<div class="line">    <a class="code" href="group___ocilib_c_api_binding.html#ga8f0d6c8afdedc2f2d774e326647afe3d">OCI_BindColl</a>(st, OTEXT(<span class="stringliteral">&quot;:tab_emp&quot;</span>), coll);</div>
<div class="line">    <a class="code" href="group___ocilib_c_api_binding.html#ga8ea9fd598d76c65637827040f28aff7e">OCI_BindUnsignedInt</a>(st, OTEXT(<span class="stringliteral">&quot;:id&quot;</span>), &amp;i);</div>
<div class="line"></div>
<div class="line">    i = 1;</div>
<div class="line"></div>
<div class="line">    <a class="code" href="group___ocilib_c_api_statements.html#ga7189aa353845909aaedc8d5956429450">OCI_Execute</a>(st);</div>
<div class="line"></div>
<div class="line">    iter = <a class="code" href="group___ocilib_c_api_collections.html#ga22abd2fab4b93cceda5de975574d1b6e">OCI_IterCreate</a>(coll);</div>
<div class="line">    elem = <a class="code" href="group___ocilib_c_api_collections.html#gadfd202892038306f96b043d06e795133">OCI_IterGetNext</a>(iter);</div>
<div class="line"></div>
<div class="line">    print_frmt(<span class="stringliteral">&quot;Department ID #%u\n\n&quot;</span>, i);</div>
<div class="line"></div>
<div class="line">    <span class="keywordflow">while</span> (elem != NULL)</div>
<div class="line">    {</div>
<div class="line">        print_text(<span class="stringliteral">&quot;... Employee : &quot;</span>);</div>
<div class="line">        print_ostr(<a class="code" href="group___ocilib_c_api_collections.html#ga9ad058296702b98426c58bbabb60faa5">OCI_ElemGetString</a>(elem));</div>
<div class="line">        print_text(<span class="stringliteral">&quot;\n&quot;</span>);</div>
<div class="line"></div>
<div class="line">        elem = <a class="code" href="group___ocilib_c_api_collections.html#gadfd202892038306f96b043d06e795133">OCI_IterGetNext</a>(iter);</div>
<div class="line">    }</div>
<div class="line"></div>
<div class="line">    <a class="code" href="group___ocilib_c_api_collections.html#ga9b186234fa7bfd143e2fecb126c7a8a4">OCI_IterFree</a>(iter);</div>
<div class="line">    <a class="code" href="group___ocilib_c_api_collections.html#ga8663babe980c99ff0441feedff973912">OCI_CollFree</a>(coll);</div>
<div class="line"></div>
<div class="line">    print_text(<span class="stringliteral">&quot;\n&gt;&gt;&gt;&gt;&gt; TEST VARRAY FETCHING WITH ITERATOR \n\n&quot;</span>);</div>
<div class="line"></div>
<div class="line">    <a class="code" href="group___ocilib_c_api_statements.html#ga8b2b66994f847d9f0b6b0efe4a13ccf3">OCI_ExecuteStmt</a>(st, OTEXT(<span class="stringliteral">&quot;SELECT * from test_coll_varray&quot;</span>));</div>
<div class="line"></div>
<div class="line">    rs = <a class="code" href="group___ocilib_c_api_fetching.html#gaf2a9e28b66a9538ba0ffb62bffb87c16">OCI_GetResultset</a>(st);</div>
<div class="line"></div>
<div class="line">    <span class="keywordflow">while</span> (<a class="code" href="group___ocilib_c_api_fetching.html#ga36ac26dcea78f6074421781e401f97ba">OCI_FetchNext</a>(rs))</div>
<div class="line">    {</div>
<div class="line">        coll = <a class="code" href="group___ocilib_c_api_fetching.html#gaef57431fc441f687418f6fedd341ce5a">OCI_GetColl</a>(rs, 2);</div>
<div class="line"></div>
<div class="line">        iter = <a class="code" href="group___ocilib_c_api_collections.html#ga22abd2fab4b93cceda5de975574d1b6e">OCI_IterCreate</a>(coll);</div>
<div class="line">        elem = <a class="code" href="group___ocilib_c_api_collections.html#gadfd202892038306f96b043d06e795133">OCI_IterGetNext</a>(iter);</div>
<div class="line"></div>
<div class="line">        print_frmt(<span class="stringliteral">&quot;\nDepartment ID #%d\n\n&quot;</span>, <a class="code" href="group___ocilib_c_api_fetching.html#gaa8d80dc30b2012eaddd13efa9dfb711d">OCI_GetInt</a>(rs, 1));</div>
<div class="line"></div>
<div class="line">        <span class="keywordflow">while</span> (elem != NULL)</div>
<div class="line">        {</div>
<div class="line">            print_text(<span class="stringliteral">&quot;... Employee : &quot;</span>);</div>
<div class="line">            print_ostr(<a class="code" href="group___ocilib_c_api_collections.html#ga9ad058296702b98426c58bbabb60faa5">OCI_ElemGetString</a>(elem));</div>
<div class="line">            print_text(<span class="stringliteral">&quot;\n&quot;</span>);</div>
<div class="line"></div>
<div class="line">            elem = <a class="code" href="group___ocilib_c_api_collections.html#gadfd202892038306f96b043d06e795133">OCI_IterGetNext</a>(iter);</div>
<div class="line">        }</div>
<div class="line"></div>
<div class="line">        <a class="code" href="group___ocilib_c_api_collections.html#ga9b186234fa7bfd143e2fecb126c7a8a4">OCI_IterFree</a>(iter);</div>
<div class="line">    }</div>
<div class="line"></div>
<div class="line">    print_text(<span class="stringliteral">&quot;\n&gt;&gt;&gt;&gt;&gt; TEST VARRAY PRINTING \n\n&quot;</span>);</div>
<div class="line"></div>
<div class="line">    <span class="keywordflow">if</span> (<a class="code" href="group___ocilib_c_api_collections.html#ga3434ad9f470b57b08e88bcdbe68c6894">OCI_CollToText</a>(coll, &amp;n, NULL))</div>
<div class="line">    {</div>
<div class="line">        otext *tmp_str = (otext* ) calloc(n+1, <span class="keyword">sizeof</span>(otext));</div>
<div class="line"></div>
<div class="line">        <span class="keywordflow">if</span> (tmp_str)</div>
<div class="line">        {</div>
<div class="line">            <a class="code" href="group___ocilib_c_api_collections.html#ga3434ad9f470b57b08e88bcdbe68c6894">OCI_CollToText</a>(coll, &amp;n, tmp_str);</div>
<div class="line">            print_ostr(tmp_str);</div>
<div class="line">            print_text(<span class="stringliteral">&quot;\n&quot;</span>);</div>
<div class="line"></div>
<div class="line">            free(tmp_str);</div>
<div class="line">        }</div>
<div class="line">    }</div>
<div class="line"></div>
<div class="line">    print_text(<span class="stringliteral">&quot;\n&gt;&gt;&gt;&gt;&gt; TEST NESTED TABLE FETCHING WITH INDEX ACCESS \n\n&quot;</span>);</div>
<div class="line"></div>
<div class="line">    <a class="code" href="group___ocilib_c_api_statements.html#ga8b2b66994f847d9f0b6b0efe4a13ccf3">OCI_ExecuteStmt</a>(st, OTEXT(<span class="stringliteral">&quot;SELECT * from test_coll_nested&quot;</span>));</div>
<div class="line"></div>
<div class="line">    rs = <a class="code" href="group___ocilib_c_api_fetching.html#gaf2a9e28b66a9538ba0ffb62bffb87c16">OCI_GetResultset</a>(st);</div>
<div class="line"></div>
<div class="line">    <span class="keywordflow">while</span> (<a class="code" href="group___ocilib_c_api_fetching.html#ga36ac26dcea78f6074421781e401f97ba">OCI_FetchNext</a>(rs))</div>
<div class="line">    {</div>
<div class="line">        coll = <a class="code" href="group___ocilib_c_api_fetching.html#gaef57431fc441f687418f6fedd341ce5a">OCI_GetColl</a>(rs, 2);</div>
<div class="line"></div>
<div class="line">        print_frmt(<span class="stringliteral">&quot;\nDepartment ID #%d\n\n&quot;</span>, <a class="code" href="group___ocilib_c_api_fetching.html#gaa8d80dc30b2012eaddd13efa9dfb711d">OCI_GetInt</a>(rs, 1));</div>
<div class="line"></div>
<div class="line">        n = <a class="code" href="group___ocilib_c_api_collections.html#ga450564910d9447ce525e76880728d2aa">OCI_CollGetSize</a>(coll);</div>
<div class="line"></div>
<div class="line">        <span class="keywordflow">for</span>(i = 1; i &lt;= n; i++)</div>
<div class="line">        {</div>
<div class="line">            elem = OCI_CollGetAt(coll, i);</div>
<div class="line"></div>
<div class="line">            print_text(<span class="stringliteral">&quot;... Employee : &quot;</span>);</div>
<div class="line">            print_ostr(<a class="code" href="group___ocilib_c_api_collections.html#ga9ad058296702b98426c58bbabb60faa5">OCI_ElemGetString</a>(elem));</div>
<div class="line">            print_text(<span class="stringliteral">&quot;\n&quot;</span>);</div>
<div class="line"></div>
<div class="line">        }</div>
<div class="line">    }</div>
<div class="line">}</div>
<div class="line"></div>
<div class="line"><span class="comment">/* --------------------------------------------------------------------------------------------- *</span></div>
<div class="line"><span class="comment"> * test_ref</span></div>
<div class="line"><span class="comment"> * --------------------------------------------------------------------------------------------- */</span></div>
<div class="line"></div>
<div class="line"><span class="keywordtype">void</span> test_ref(<span class="keywordtype">void</span>)</div>
<div class="line">{</div>
<div class="line">    <a class="code" href="group___ocilib_c_api_datatypes.html#ga0e6344d3d91bcf39059894adc19f011a">OCI_Ref</a>    *ref;</div>
<div class="line">    <a class="code" href="group___ocilib_c_api_datatypes.html#ga270329793bf4735351b6007bc20d41ae">OCI_Object</a> *obj;</div>
<div class="line"></div>
<div class="line">    print_text(<span class="stringliteral">&quot;\n&gt;&gt;&gt;&gt;&gt; TEST REF FETCHING \n\n&quot;</span>);</div>
<div class="line"></div>
<div class="line">    <a class="code" href="group___ocilib_c_api_statements.html#ga8b2b66994f847d9f0b6b0efe4a13ccf3">OCI_ExecuteStmt</a>(st, OTEXT(<span class="stringliteral">&quot;select ref(e) from test_table_obj e&quot;</span>));</div>
<div class="line">    rs = <a class="code" href="group___ocilib_c_api_fetching.html#gaf2a9e28b66a9538ba0ffb62bffb87c16">OCI_GetResultset</a>(st);</div>
<div class="line"></div>
<div class="line">    <span class="keywordflow">while</span> (<a class="code" href="group___ocilib_c_api_fetching.html#ga36ac26dcea78f6074421781e401f97ba">OCI_FetchNext</a>(rs))</div>
<div class="line">    {</div>
<div class="line">        ref = <a class="code" href="group___ocilib_c_api_fetching.html#gaa9376300d7b7a383e98cacb809677a5d">OCI_GetRef</a>(rs, 1);</div>
<div class="line"></div>
<div class="line">        obj = <a class="code" href="group___ocilib_c_api_user_types.html#gae101916e55785052645366228f3a8751">OCI_RefGetObject</a>(ref);</div>
<div class="line"></div>
<div class="line">        print_frmt(<span class="stringliteral">&quot;%i - &quot;</span>, <a class="code" href="group___ocilib_c_api_user_types.html#gae08835d39b227d5af9348be9ba20829d">OCI_ObjectGetInt</a>(obj, OTEXT(<span class="stringliteral">&quot;ID&quot;</span>)));</div>
<div class="line">        print_ostr(<a class="code" href="group___ocilib_c_api_user_types.html#gad495abec0bf414a31a6689e6de33335c">OCI_ObjectGetString</a>(obj, OTEXT(<span class="stringliteral">&quot;NAME&quot;</span>)));</div>
<div class="line">        print_text(<span class="stringliteral">&quot;\n&quot;</span>);</div>
<div class="line">    }</div>
<div class="line"></div>
<div class="line">    print_text(<span class="stringliteral">&quot;\n&gt;&gt;&gt;&gt;&gt; TEST REF PL/SQL BINDING \n\n&quot;</span>);</div>
<div class="line"></div>
<div class="line">    ref = <a class="code" href="group___ocilib_c_api_user_types.html#gadd765dc3c5ebe2f3472c4fc2760e9b29">OCI_RefCreate</a>(cn, <a class="code" href="group___ocilib_c_api_metadata.html#ga541bb34a0a86c6296f59605f85931039">OCI_TypeInfoGet</a>(cn, OTEXT(<span class="stringliteral">&quot;type_t&quot;</span>), OCI_TIF_TYPE));</div>
<div class="line"></div>
<div class="line">    <a class="code" href="group___ocilib_c_api_statements.html#ga592e4b3cf3df7e152c46fab5d6e3b3af">OCI_Prepare</a>(st, OTEXT(<span class="stringliteral">&quot;begin &quot;</span>)</div>
<div class="line">                    OTEXT(<span class="stringliteral">&quot;  select ref(e) into :r from test_table_obj e where e.id = 1; &quot;</span>)</div>
<div class="line">                    OTEXT(<span class="stringliteral">&quot;end; &quot;</span>));</div>
<div class="line"></div>
<div class="line">    <a class="code" href="group___ocilib_c_api_binding.html#ga0f47b0b8aa18388f0c552f71df73c4e9">OCI_BindRef</a>(st, OTEXT(<span class="stringliteral">&quot;:r&quot;</span>), ref);</div>
<div class="line">    <a class="code" href="group___ocilib_c_api_statements.html#ga7189aa353845909aaedc8d5956429450">OCI_Execute</a>(st);</div>
<div class="line"></div>
<div class="line">    obj = <a class="code" href="group___ocilib_c_api_user_types.html#gae101916e55785052645366228f3a8751">OCI_RefGetObject</a>(ref);</div>
<div class="line">    print_frmt(<span class="stringliteral">&quot;%i - &quot;</span>, <a class="code" href="group___ocilib_c_api_user_types.html#gae08835d39b227d5af9348be9ba20829d">OCI_ObjectGetInt</a>(obj, OTEXT(<span class="stringliteral">&quot;ID&quot;</span>)));</div>
<div class="line">    print_ostr(<a class="code" href="group___ocilib_c_api_user_types.html#gad495abec0bf414a31a6689e6de33335c">OCI_ObjectGetString</a>(obj, OTEXT(<span class="stringliteral">&quot;NAME&quot;</span>)));</div>
<div class="line">    print_text(<span class="stringliteral">&quot;\n&quot;</span>);</div>
<div class="line"></div>
<div class="line">    <a class="code" href="group___ocilib_c_api_user_types.html#ga4d38338b68e78fbf2be15a9fc7a01b46">OCI_RefFree</a>(ref);</div>
<div class="line">}</div>
<div class="line"></div>
<div class="line"><span class="comment">/* --------------------------------------------------------------------------------------------- *</span></div>
<div class="line"><span class="comment"> * test_directpath</span></div>
<div class="line"><span class="comment"> * --------------------------------------------------------------------------------------------- */</span></div>
<div class="line"></div>
<div class="line"><span class="keywordtype">void</span> test_directpath(<span class="keywordtype">void</span>)</div>
<div class="line">{</div>
<div class="line">   <span class="comment">/* Some OCI Direct path function fails (segfault) if the OCI version of the</span></div>
<div class="line"><span class="comment">      client is different than the server one.</span></div>
<div class="line"><span class="comment">      It happens with OCI 8i and 9i client. Apparently Oracle 10g and 11g seems to</span></div>
<div class="line"><span class="comment">      have fixed these problems.</span></div>
<div class="line"><span class="comment">      Anyway, we run this test case only if the major versions of client and server</span></div>
<div class="line"><span class="comment">      match</span></div>
<div class="line"><span class="comment">   */</span></div>
<div class="line"></div>
<div class="line">   <span class="keywordflow">if</span> (OCI_VER_MAJ(<a class="code" href="group___ocilib_c_api_initialization.html#ga771bf5d33dbd0b63d84242819209b35b">OCI_GetOCIRuntimeVersion</a>()) == <a class="code" href="group___ocilib_c_api_connections.html#ga2d7618d8eae73643dd75067a40e656a1">OCI_GetServerMajorVersion</a>(cn))</div>
<div class="line">   {</div>
<div class="line">        <a class="code" href="group___ocilib_c_api_datatypes.html#ga7ad67a3c6bb06fa04fcf3eae68af599a">OCI_DirPath</a> *dp;</div>
<div class="line">        <a class="code" href="group___ocilib_c_api_datatypes.html#gad33099e82262f1f484c19283d5f812c6">OCI_TypeInfo</a> *tbl;</div>
<div class="line">        <span class="keywordtype">boolean</span> res = TRUE;</div>
<div class="line"></div>
<div class="line">        otext val1[SIZE_COL1+1];</div>
<div class="line">        otext val2[SIZE_COL2+1];</div>
<div class="line">        otext val3[SIZE_COL3+1];</div>
<div class="line"></div>
<div class="line">        <span class="keywordtype">int</span> i = 0, j = 0, nb_rows = SIZE_ARRAY;</div>
<div class="line">        <span class="keywordtype">int</span> state;</div>
<div class="line"></div>
<div class="line">       <span class="comment">/* commit any previous pending modifications */</span></div>
<div class="line"></div>
<div class="line">        <a class="code" href="group___ocilib_c_api_transactions.html#gaee1ba614ed2dc5bd83bf788ca08f3e71">OCI_Commit</a>(cn);</div>
<div class="line"></div>
<div class="line">        print_text(<span class="stringliteral">&quot;\n&gt;&gt;&gt;&gt;&gt; TEST DIRECT PATH (10 loads of 100 rows) \n\n&quot;</span>);</div>
<div class="line"></div>
<div class="line">        tbl = <a class="code" href="group___ocilib_c_api_metadata.html#ga541bb34a0a86c6296f59605f85931039">OCI_TypeInfoGet</a>(cn, OTEXT(<span class="stringliteral">&quot;test_directpath&quot;</span>), OCI_TIF_TABLE);</div>
<div class="line">        dp  = <a class="code" href="group___ocilib_c_apidirect_path.html#ga33415cbda0a997c10ae0815256701935">OCI_DirPathCreate</a>(tbl, NULL, NUM_COLS, nb_rows);</div>
<div class="line"></div>
<div class="line">        <span class="comment">/* optional attributes to set */</span></div>
<div class="line"></div>
<div class="line">        res = res &amp;&amp; <a class="code" href="group___ocilib_c_apidirect_path.html#gae25febeb9086f1604743fbf54a4cf677">OCI_DirPathSetBufferSize</a>(dp, 64000);</div>
<div class="line">        res = res &amp;&amp; <a class="code" href="group___ocilib_c_apidirect_path.html#ga59a031e1515afd31654105071dc7e371">OCI_DirPathSetNoLog</a>(dp, TRUE);</div>
<div class="line">        res = res &amp;&amp; <a class="code" href="group___ocilib_c_apidirect_path.html#gafab72b4c04bd2c5d3c850f58f5b22fd2">OCI_DirPathSetParallel</a>(dp, TRUE);</div>
<div class="line"></div>
<div class="line">        <span class="keywordflow">if</span>(<a class="code" href="group___ocilib_c_api_initialization.html#ga771bf5d33dbd0b63d84242819209b35b">OCI_GetOCIRuntimeVersion</a>() &gt;= OCI_9_2)</div>
<div class="line">        {</div>
<div class="line">            res = res &amp;&amp; <a class="code" href="group___ocilib_c_apidirect_path.html#gaa0976d38ccf4d6f09657115ad6e47880">OCI_DirPathSetCacheSize</a>(dp, 100);</div>
<div class="line">        }</div>
<div class="line"></div>
<div class="line">        <span class="comment">/* describe the target table */</span></div>
<div class="line"></div>
<div class="line">        res = res &amp;&amp; <a class="code" href="group___ocilib_c_apidirect_path.html#ga37fecbbc3ecaa6c3ecfe33539aef1f69">OCI_DirPathSetColumn</a>(dp, 1, OTEXT(<span class="stringliteral">&quot;VAL_INT&quot;</span>),  SIZE_COL1, NULL);</div>
<div class="line">        res = res &amp;&amp; <a class="code" href="group___ocilib_c_apidirect_path.html#ga37fecbbc3ecaa6c3ecfe33539aef1f69">OCI_DirPathSetColumn</a>(dp, 2, OTEXT(<span class="stringliteral">&quot;VAL_STR&quot;</span>),  SIZE_COL2, NULL);</div>
<div class="line">        res = res &amp;&amp; <a class="code" href="group___ocilib_c_apidirect_path.html#ga37fecbbc3ecaa6c3ecfe33539aef1f69">OCI_DirPathSetColumn</a>(dp, 3, OTEXT(<span class="stringliteral">&quot;VAL_DATE&quot;</span>), SIZE_COL3, OTEXT(<span class="stringliteral">&quot;YYYYMMDD&quot;</span>));</div>
<div class="line"></div>
<div class="line">        <span class="comment">/* prepare the load */</span></div>
<div class="line"></div>
<div class="line">        res = res &amp;&amp; <a class="code" href="group___ocilib_c_apidirect_path.html#ga31aae5239710847d43b90166fedf0419">OCI_DirPathPrepare</a>(dp);</div>
<div class="line"></div>
<div class="line">        <span class="keywordflow">if</span> (res)</div>
<div class="line">        {</div>
<div class="line">            nb_rows = <a class="code" href="group___ocilib_c_apidirect_path.html#ga2ff812128f1604615f186aa8bdf8269d">OCI_DirPathGetMaxRows</a>(dp);          </div>
<div class="line">            </div>
<div class="line">            <span class="keywordflow">for</span> (i = 0; i &lt; NB_LOAD ; i++)</div>
<div class="line">            {</div>
<div class="line">                <a class="code" href="group___ocilib_c_apidirect_path.html#ga2efc984ff0647d3a3c4b29f7e9ec37e2">OCI_DirPathReset</a>(dp);</div>
<div class="line"></div>
<div class="line">                <span class="keywordflow">for</span> (j = 1; j &lt;= nb_rows &amp;&amp; res; j++)</div>
<div class="line">                {</div>
<div class="line">                    <span class="comment">/* fill test values */</span></div>
<div class="line"></div>
<div class="line">                    osprintf(val1, SIZE_COL1+1, OTEXT(<span class="stringliteral">&quot;%04d&quot;</span>), i + (i*100));</div>
<div class="line">                    osprintf(val2, SIZE_COL2+1, OTEXT(<span class="stringliteral">&quot;value %05d&quot;</span>), j + (i*100));</div>
<div class="line">                    osprintf(val3, SIZE_COL3+1, OTEXT(<span class="stringliteral">&quot;%04d%02d%02d&quot;</span>), (j%23)+1 + 2000,</div>
<div class="line">                                                                     (j%11)+1,</div>
<div class="line">                                                                     (j%23)+1);</div>
<div class="line"></div>
<div class="line">                    res = res &amp;&amp; <a class="code" href="group___ocilib_c_apidirect_path.html#gaaadd5e79891c24d0f9c99ed96e5fe608">OCI_DirPathSetEntry</a>(dp, j, 1, val1, (<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span>) ostrlen(val1), TRUE);</div>
<div class="line">                    res = res &amp;&amp; <a class="code" href="group___ocilib_c_apidirect_path.html#gaaadd5e79891c24d0f9c99ed96e5fe608">OCI_DirPathSetEntry</a>(dp, j, 2, val2, (<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span>) ostrlen(val2), TRUE);</div>
<div class="line">                    res = res &amp;&amp; <a class="code" href="group___ocilib_c_apidirect_path.html#gaaadd5e79891c24d0f9c99ed96e5fe608">OCI_DirPathSetEntry</a>(dp, j, 3, val3, (<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span>) ostrlen(val3), TRUE);</div>
<div class="line">                }</div>
<div class="line"></div>
<div class="line">               <span class="comment">/* load data to the server */</span></div>
<div class="line"></div>
<div class="line">                <span class="keywordflow">while</span> (res == TRUE)</div>
<div class="line">                {</div>
<div class="line">                    state = <a class="code" href="group___ocilib_c_apidirect_path.html#ga8dd680e9664028af035e773275e5ab76">OCI_DirPathConvert</a>(dp);</div>
<div class="line"></div>
<div class="line">                    <span class="keywordflow">if</span> ((state == OCI_DPR_FULL) || (state == OCI_DPR_COMPLETE))</div>
<div class="line">                        res = <a class="code" href="group___ocilib_c_apidirect_path.html#ga0c816466d046a3d8c179f779e273f456">OCI_DirPathLoad</a>(dp);</div>
<div class="line"></div>
<div class="line">                    <span class="keywordflow">if</span> (state == OCI_DPR_COMPLETE)</div>
<div class="line">                        <span class="keywordflow">break</span>;</div>
<div class="line">                }</div>
<div class="line">            }</div>
<div class="line"></div>
<div class="line">            <span class="comment">/* commits changes */</span></div>
<div class="line"></div>
<div class="line">            res = res &amp;&amp; <a class="code" href="group___ocilib_c_apidirect_path.html#ga7c80a8db7ef79e4693ac0e770bb2018f">OCI_DirPathFinish</a>(dp);</div>
<div class="line"></div>
<div class="line">            <span class="keywordflow">if</span> (res)</div>
<div class="line">            {</div>
<div class="line">                print_frmt(<span class="stringliteral">&quot;%04u row(s) loaded\n&quot;</span>, <a class="code" href="group___ocilib_c_apidirect_path.html#gaffb07d43825826b0c9af060ee52fc3e0">OCI_DirPathGetRowCount</a>(dp));</div>
<div class="line">            }</div>
<div class="line"></div>
<div class="line">            <span class="comment">/* free direct path object */</span></div>
<div class="line">        }</div>
<div class="line"></div>
<div class="line">        <a class="code" href="group___ocilib_c_apidirect_path.html#ga024f04e69293349e3882b2f367a03ed6">OCI_DirPathFree</a>(dp);</div>
<div class="line">   }</div>
<div class="line">}</div>
<div class="line"></div>
</div><!-- fragment --> </div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="footer">Generated on Mon Mar 21 2016 22:26:38 for OCILIB (C and C++ Driver for Oracle) by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.9.1 </li>
  </ul>
</div>
</body>
</html>
